Пример #1
0
        public SMSSendListBLL(DataConnectType dct)
        {
            _infomation = string.Empty;

            _dct = dct;

            model = new SMSSendListModel();
        }
Пример #2
0
        public SMSSendListBLL()
        {
            _infomation = string.Empty;

            _dct = DataConnectType.ServerDBDataService;

            model = new SMSSendListModel();
        }
Пример #3
0
        private void DoAction(SendMsgStruct[] array)
        {
            if (array != null && array.Length > 0)
            {
                SMSSendListModel model   = new SMSSendListModel();
                DataTable        dtWrite = model.Tables[0];

                foreach (SendMsgStruct item in array)
                {
                    DataRow dr = dtWrite.NewRow();

                    dr[SMSSendListModel.CSShortName] = item.CSShortName;
                    dr[SMSSendListModel.UserName]    = item.UserName;
                    dr[SMSSendListModel.HName]       = item.HName;
                    dr[SMSSendListModel.UniqueID]    = item.UniqueID;
                    dr[SMSSendListModel.ReceiveTime] = new DateTime(item.ReceiveTime).ToString("yyyy-MM-dd HH:mm:ss");
                    dr[SMSSendListModel.TelNumber]   = item.TelNumber;
                    dr[SMSSendListModel.Content]     = item.Content;
                    dr[SMSSendListModel.BatchID]     = item.BatchID;
                    dr[SMSSendListModel.SendTime]    = new DateTime(item.SendTime).ToString("yyyy-MM-dd HH:mm:ss");
                    dr[SMSSendListModel.SendState]   = item.SendState;
                    dr[SMSSendListModel.ErrorMsg]    = item.ErrorMsg;


                    dtWrite.Rows.Add(dr);
                }

                CommonBll cBll = new CommonBll(SP.DataConnectType.CustomDBDataService);
                if (cBll.BulkInsert(model))
                {
                    LastExecTime = DateTime.Now;
                }
                else//error
                {
                    AsyncHelper.RunSync <bool>(() => Manager.Instance.WriteLogFile("SendDBLogWorker_BulkInsert未插入"));
                }
            }
        }