using ASHermed.SinoInterface.Api.ContractModel;
using ASHermed.SinoInterface.Api.IRepository;
using ASHermed.SinoInterface.Repository.MySql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASHermed.SinoInterface.Api.MySqlRepository
{
    public class OutNoticeInfoRepository : BaseRepositoryToASHermed_SinoInterface<Out_Notice_Info>, IOutNoticeInfoRepository
    {
        public int InsertOutNoticeInfo(Out_Notice_Info info)
        {
            StringBuilder str = new StringBuilder();
            str.Append("insert into out_notice_info (TEXT,NOTICE_TYPE,IS_READ,USER_ID,STATES,CREATE_USER,CREATE_TIME,BUSINESS,BUSINESS_TYPE,REMAKE)  values (@TEXT,@NOTICE_TYPE,@IS_READ,@USER_ID,@STATES,@CREATE_USER,@CREATE_TIME,@BUSINESS,@BUSINESS_TYPE,@REMAKE)");
            var parms = new Dictionary<string, object>();
            parms.Add("@TEXT", info.Text);
            parms.Add("@NOTICE_TYPE", info.Notice_Type);
            parms.Add("@IS_READ", info.Is_Read);
            parms.Add("@USER_ID", info.User_Id);
            parms.Add("@STATES", info.States);
            parms.Add("@CREATE_USER", info.Create_User);
            parms.Add("@CREATE_TIME", info.Create_Time);
            parms.Add("@BUSINESS", info.Business);
            parms.Add("@BUSINESS_TYPE", info.Business_Type);
            parms.Add("@REMAKE", info.Remake);
            var result = Insert(str.ToString(), parms);
            return result;
        }

        //public int UpdateByPrimaryKey(Pub_Sms_Log smsLog)
        //{
        //    var parms = new Dictionary<string, object>();
        //    StringBuilder str = new StringBuilder();
        //    str.Append(@"update Pub_Sms_Log set
        //                    SMS_TYPE =@SMS_TYPE, 
        //                    REQUEST=@REQUEST,
        //                    RESULT=@RESULT,
        //                    SEND_TIME=@SEND_TIME,
        //                    SMS_CONTENT=@SMS_CONTENT
        //                    where ID=@ID
        //                    ");
        //    parms.Add("@SMS_TYPE", smsLog.Sms_Type);
        //    parms.Add("@REQUEST", smsLog.Request);
        //    parms.Add("@RESULT", smsLog.Result);
        //    parms.Add("@SEND_TIME", smsLog.Send_Time);
        //    parms.Add("@SMS_CONTENT", smsLog.Sms_Type);
        //    parms.Add("@ID", smsLog.Id);
        //    var result = Execute(str.ToString(), parms);
        //    return result;
        //}



    }
}
