Exemple #1
0
        protected void btnSaveSPAdReport_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPAdReportWrapper obj = new SPAdReportWrapper();
                //obj.ID = Convert.ToInt32(this.numID.Value.Trim());
                obj.SPAdID            = Convert.ToInt32(this.cmbAd.SelectedItem.Value);
                obj.SPPackID          = SPAdPackWrapper.FindById(Convert.ToInt32(this.cmbAdPack.Value));
                obj.SPClientID        = SPSClientWrapper.FindById(Convert.ToInt32(this.cmbClient.Value));
                obj.ReportDate        = this.dateReportDate.SelectedDate;
                obj.ClientCount       = Convert.ToInt32(this.numClientCount.Value);
                obj.AdCount           = Convert.ToInt32(this.numAdCount.Value);
                obj.AdClientUseCount  = Convert.ToInt32(this.numAdClientUseCount.Value);
                obj.AdUseCount        = Convert.ToInt32(this.numAdUseCount.Value);
                obj.AdClientDownCount = Convert.ToInt32(this.numAdClientDownCount.Value);
                obj.AdDownCount       = Convert.ToInt32(this.numAdDownCount.Value);
                obj.AdAmount          = 1;
                obj.CreateAt          = System.DateTime.Now;
                obj.LastModifyAt      = System.DateTime.Now;
                SPAdReportWrapper.SaveNewReport(obj);

                winSPAdReportAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Exemple #2
0
        protected void btnSaveSPCode_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPCodeWrapper codeWrapper = CodeID;

                SPSClientWrapper client =
                    SPSClientWrapper.FindById(Convert.ToInt32(cmbAssignedClient.SelectedItem.Value));


                DateTime changeDate = System.DateTime.Now;

                int changeUserID = this.CurrentLoginUser.UserID;

                decimal price = Convert.ToDecimal(this.txtPrice.Text.Trim());

                decimal interceptRate = Convert.ToDecimal(this.txtInterceptRate.Text.Trim());

                bool syncData = this.chkSyncData.Checked;

                int sycnNotInterceptCount = Convert.ToInt32(this.txtSycnNotInterceptCount.Text.Trim());

                string sycnRetryTimes = this.txtSycnRetryTimes.Text.Trim();

                SPSDataSycnSettingWrapper dataSycnSetting = null;

                if (syncData)
                {
                    dataSycnSetting = new SPSDataSycnSettingWrapper();

                    dataSycnSetting.SycnMO              = true;
                    dataSycnSetting.SyncType            = "1";
                    dataSycnSetting.SycnMOUrl           = this.txtSycnDataUrl.Text.Trim();
                    dataSycnSetting.SycnMOOkMessage     = this.txtSycnOkMessage.Text.Trim();
                    dataSycnSetting.SycnMOFailedMessage = this.txtSycnFailedMessage.Text.Trim();
                }


                try
                {
                    codeWrapper.ChangeClient(client,
                                             changeDate, changeUserID, price, interceptRate, syncData, sycnNotInterceptCount, sycnRetryTimes, dataSycnSetting
                                             );
                }
                catch (Exception ex)
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                }

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemple #3
0
        public void Show(int id)
        {
            try
            {
                SPSClientWrapper obj = SPSClientWrapper.FindById(id);

                if (obj != null)
                {
                    this.lblName.Text        = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.lblDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);
                    //this.lblRecieveDataUrl.Text = ValueConvertUtil.ConvertStringValue(obj.RecieveDataUrl);
                    //this.lblUserID.Text = obj.UserID.ToString();
                    ////this.lblSyncData.Text = ValueConvertUtil.ConvertNullableValue<bool>(obj.SyncData);
                    //this.lblOkMessage.Text = ValueConvertUtil.ConvertStringValue(obj.DataOkMessage);
                    //this.lblFailedMessage.Text = ValueConvertUtil.ConvertStringValue(obj.FailedMessage);
                    if (obj.SyncDataSetting != null)
                    {
                        this.lblSyncType.Text = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SyncType);
                    }
                    else
                    {
                        this.lblSyncType.Text = "";
                    }
                    this.lblAlias.Text         = ValueConvertUtil.ConvertStringValue(obj.Alias);
                    this.lblInterceptRate.Text = obj.InterceptRate.ToString();
                    this.lblDefaultPrice.Text  = obj.DefaultPrice.ToString();



                    //hidLogID.Text = id.ToString();


                    winSPSClientView.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPSClient_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPSClientWrapper obj = SPSClientWrapper.FindById(int.Parse(hidId.Text.Trim()));

                SystemUserWrapper clientUser = SystemUserWrapper.FindById(obj.UserID);

                if (clientUser.UserLoginID != this.txtUserID.Text.Trim())
                {
                    if (SystemUserWrapper.FindByLoginID(this.txtUserID.Text.Trim()) != null)
                    {
                        ResourceManager.AjaxSuccess      = false;
                        ResourceManager.AjaxErrorMessage = "错误信息:用户已存在。";
                    }
                }


                clientUser.UserLoginID = this.txtUserID.Text.Trim();

                SPSClientWrapper.Update(obj);

                if (this.chkChangePassword.Checked && !string.IsNullOrEmpty(this.txtUserPasword.Text.Trim()))
                {
                    if (!((NHibernateMembershipProvider)Membership.Provider).ChangePassword(clientUser.UserLoginID, this.txtUserPasword.Text.Trim()))
                    {
                        ResourceManager.AjaxSuccess      = false;
                        ResourceManager.AjaxErrorMessage = "Change Password Failed!";
                        return;
                    }
                }



                winSPClientChangeUserLoginInfo.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
        protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            SPSClientWrapper client = null;

            if (this.cmbClient.SelectedItem != null)
            {
                client = SPSClientWrapper.FindById(Convert.ToInt32(this.cmbClient.SelectedItem.Value));
            }

            if (client != null)
            {
                this.storeSPCode.DataSource = client.GetAllAssignedCode();
            }
            else
            {
                this.storeSPCode.DataSource = new List <SPCodeWrapper>();
            }

            this.storeSPCode.DataBind();
        }
        public void Show(int id)
        {
            try
            {
                SPSClientWrapper obj = SPSClientWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtName.Text = ValueConvertUtil.ConvertStringValue(obj.Name);

                    SystemUserWrapper clientUser = SystemUserWrapper.FindById(obj.UserID);

                    this.txtUserID.Text = clientUser.UserLoginID;

                    chkChangePassword.Checked = false;

                    this.txtUserPasword.Text = "";

                    hidId.Text = id.ToString();


                    winSPClientChangeUserLoginInfo.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.QueryClientInvoiceReport(StartDate, EndDate, SPClientID, CodeID).Tables[0];


            string clientName = "所有";

            if (SPClientID.HasValue && SPClientID > 0)
            {
                clientName = "【" + SPSClientWrapper.FindById(SPClientID.Value).Name + "】";
            }

            string codeName = "";

            if (CodeID.HasValue && CodeID > 0)
            {
                codeName = "【" + SPCodeWrapper.FindById(CodeID.Value).MoCode + "】指令";
            }

            string reportName = string.Format("【{0}】-【{1}】 {2} 客户 {3} 结算报表", StartDate.Value.ToString("yyyy-MM-dd"),
                                              EndDate.Value.ToString("yyyy-MM-dd"), clientName, codeName);

            ReportViewHelper.BindDataTableToReport(rptvContainer, tb, "DataSet1", reportName);
        }
Exemple #8
0
        private static void RunAsCmd(string[] args)
        {
            AllocConsole();

            string cmdName = args[1];

            //Console.WriteLine("短信发送程序命令行方式启动,按任意键盘退出。");

            int clientID = 0;

            if (args.Length > 2)
            {
                int.TryParse(args[2], out clientID);
            }

            int codeID = 0;

            if (args.Length > 3)
            {
                int.TryParse(args[3], out codeID);
            }

            switch (cmdName.ToLower())
            {
            case "sendtodaydata":

                string sendobj = string.Empty;

                SPSClientWrapper client = null;

                if ((clientID != 0))
                {
                    client = SPSClientWrapper.FindById(clientID);

                    if (client != null)
                    {
                        sendobj += " 客户【" + client.Name + "】";
                    }
                }

                SPCodeWrapper code = null;

                if ((codeID != 0))
                {
                    code = SPCodeWrapper.FindById(codeID);

                    if (code != null)
                    {
                        sendobj += " 指令【" + code.MoCode + "】";
                    }
                }

                sendobj += " 所有数据 ";

                //List<SPRecordWrapper> sendRecords = SPRecordWrapper.FindAllSendRecordByClientAndCodeAndDateRange(client, code, DateTime.Now.Date, DateTime.Now.AddDays(1).Date);



                logger.Info("开始发送“" + sendobj + "”当日数据。。。");

                logger.Info("发送“" + sendobj + "”当日数据完成。。。");


                break;

            case "sendhistorydata":
                //logger.Info("开始发送历史数据。。。");

                //logger.Info("发送历史数据完成。。。");
                break;
            }

            Console.ReadKey();
        }
        private ReportSearchCondition GetReportSearchCondition(RecordSortor eSortor)
        {
            ReportSearchCondition reportSearchCondition = new ReportSearchCondition();

            reportSearchCondition.RecordSortor = eSortor;

            reportSearchCondition.Channel = null;

            if (this.cmbChannel.SelectedItem != null)
            {
                reportSearchCondition.Channel = SPChannelWrapper.FindById(Convert.ToInt32(this.cmbChannel.SelectedItem.Value));
            }

            reportSearchCondition.Client = null;

            if (this.cmbClient.SelectedItem != null)
            {
                reportSearchCondition.Client = SPSClientWrapper.FindById(Convert.ToInt32(this.cmbClient.SelectedItem.Value));
            }

            reportSearchCondition.Code = null;

            if (this.cmbCode.SelectedItem != null)
            {
                reportSearchCondition.Code = SPCodeWrapper.FindById(Convert.ToInt32(this.cmbCode.SelectedItem.Value));
            }

            reportSearchCondition.StartDate = null;

            if (this.dfStart.SelectedValue != null)
            {
                reportSearchCondition.StartDate = this.dfStart.SelectedDate;
            }

            reportSearchCondition.EndDate = null;

            if (this.dfEnd.SelectedValue != null)
            {
                reportSearchCondition.EndDate = this.dfEnd.SelectedDate;
            }

            reportSearchCondition.QueryFilters = new List <QueryFilter>();

            if (!string.IsNullOrEmpty(this.txtPhoneNumber.Text.Trim()))
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MOBILE,
                                                                       this.txtPhoneNumber.Text.Trim(),
                                                                       FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtLinkID.Text.Trim()))
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_LINKID,
                                                                       this.txtLinkID.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtSpNumber.Text.Trim()))
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_SPNUMBER,
                                                                       this.txtSpNumber.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtMo.Text.Trim()))
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MO, this.txtMo.Text.Trim(),
                                                                       FilterFunction.StartsWith));
            }

            if (this.cmbIntercepter.SelectedItem != null && this.cmbIntercepter.SelectedItem.Value != null)
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISINTERCEPT,
                                                                       (this.cmbIntercepter.SelectedItem.Value == "1").ToString(),
                                                                       FilterFunction.EqualTo));
            }

            if (this.cmbStatus.SelectedItem != null && this.cmbStatus.SelectedItem.Value != null)
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSTATOK,
                                                                       (this.cmbStatus.SelectedItem.Value == "1").ToString(),
                                                                       FilterFunction.EqualTo));
            }

            if (this.cmbSycnStatus.SelectedItem != null && this.cmbSycnStatus.SelectedItem.Value != null)
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSYCNSUCCESSED,
                                                                       (this.cmbSycnStatus.SelectedItem.Value == "1").ToString(),
                                                                       FilterFunction.EqualTo));
            }

            if (this.cmbProvince.SelectedItem != null && this.cmbProvince.SelectedItem.Value != null)
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_PROVINCE,
                                                                       this.cmbProvince.SelectedItem.Value.ToString(),
                                                                       FilterFunction.EqualTo));
            }

            if (this.cmbOperateType.SelectedItem != null && this.cmbOperateType.SelectedItem.Value != null)
            {
                reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_OPERATORTYPE,
                                                                       this.cmbOperateType.SelectedItem.Value.ToString(),
                                                                       FilterFunction.EqualTo));
            }
            return(reportSearchCondition);
        }
        public void Show(int id)
        {
            try
            {
                SPSClientWrapper obj = SPSClientWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtName.Text        = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);

                    this.txtInterceptRate.Text     = obj.InterceptRate.ToString();
                    this.txtDefaultPrice.Text      = obj.DefaultPrice.ToString();
                    this.txtNotInterceptCount.Text = obj.SycnNotInterceptCount.ToString();
                    this.numShowDayRecord.Text     = obj.DefaultShowRecordDays.ToString();

                    this.chkSyncData.Checked = obj.SyncData;

                    if (obj.SyncData)
                    {
                        this.txtSycnRetryTimes.Show();
                        fsSyncMO.Show();
                        fsSyncMR.Hide();
                        fsSyncState.Hide();

                        if (obj.SyncDataSetting != null)
                        {
                            if (obj.SyncDataSetting.SycnMO.HasValue && obj.SyncDataSetting.SycnMO.Value)
                            {
                                fsSyncMO.Collapsed = true;
                                this.txtSycnMOFailedMessage.Text = obj.SyncDataSetting.SycnMOFailedMessage;
                                this.txtSycnMOOkMessage.Text     = obj.SyncDataSetting.SycnMOOkMessage;
                                this.txtSycnMOUrl.Text           = obj.SyncDataSetting.SycnMOUrl;
                            }
                            else
                            {
                                fsSyncMO.Collapsed = false;
                                this.txtSycnMOFailedMessage.Text = "";
                                this.txtSycnMOOkMessage.Text     = "";
                                this.txtSycnMOUrl.Text           = "";
                            }

                            if (obj.SyncDataSetting.SycnMR.HasValue && obj.SyncDataSetting.SycnMR.Value)
                            {
                                fsSyncMR.Collapsed = true;
                                this.txtSycnMRFailedMessage.Text = obj.SyncDataSetting.SycnMRFailedMessage;
                                this.txtSycnMROkMessage.Text     = obj.SyncDataSetting.SycnMROkMessage;
                                this.txtSycnMRUrl.Text           = obj.SyncDataSetting.SycnMRUrl;
                            }
                            else
                            {
                                fsSyncMR.Collapsed = false;
                                this.txtSycnMRFailedMessage.Text = "";
                                this.txtSycnMROkMessage.Text     = "";
                                this.txtSycnMRUrl.Text           = "";
                            }


                            if (obj.SyncDataSetting.SycnSate.HasValue && obj.SyncDataSetting.SycnSate.Value)
                            {
                                fsSyncState.Collapsed = true;
                                this.txtSycnStateFailedMessage.Text = obj.SyncDataSetting.SycnSateFailedMessage;
                                this.txtSycnStateOkMessage.Text     = obj.SyncDataSetting.SycnSateOkMessage;
                                this.txtSycnStateUrl.Text           = obj.SyncDataSetting.SycnSateUrl;
                            }
                            else
                            {
                                fsSyncState.Collapsed = false;
                                this.txtSycnStateFailedMessage.Text = "";
                                this.txtSycnStateOkMessage.Text     = "";
                                this.txtSycnStateUrl.Text           = "";
                            }

                            if (obj.SyncDataSetting.SycnRetryTimes.HasValue)
                            {
                                this.txtSycnRetryTimes.Text = obj.SyncDataSetting.SycnRetryTimes.Value.ToString();
                            }
                            else
                            {
                                this.txtSycnRetryTimes.Text = "3";
                            }
                        }
                    }
                    else
                    {
                        fsSyncMO.Hide();
                        fsSyncMR.Hide();
                        fsSyncState.Hide();
                        this.txtSycnRetryTimes.Hide();
                        this.txtSycnRetryTimes.Text = "3";
                    }


                    hidId.Text = id.ToString();


                    winSPSClientEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "Error Message:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPSClient_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPSClientWrapper obj = SPSClientWrapper.FindById(int.Parse(hidId.Text.Trim()));

                obj.Name        = this.txtName.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();

                obj.InterceptRate         = Convert.ToDecimal(this.txtInterceptRate.Text.Trim());
                obj.DefaultPrice          = Convert.ToDecimal(this.txtDefaultPrice.Text.Trim());
                obj.SycnNotInterceptCount = Convert.ToInt32(this.txtNotInterceptCount.Text.Trim());
                obj.DefaultShowRecordDays = Convert.ToInt32(this.numShowDayRecord.Text.Trim());
                obj.SyncData = chkSyncData.Checked;

                if (obj.SyncDataSetting == null)
                {
                    obj.SyncDataSetting = new SPSDataSycnSettingWrapper();

                    SPSDataSycnSettingWrapper.Save(obj.SyncDataSetting);
                }



                if (obj.SyncData)
                {
                    if (obj.SyncDataSetting == null)
                    {
                        SPSDataSycnSettingWrapper spsDataSycnSetting = new SPSDataSycnSettingWrapper();

                        SPSDataSycnSettingWrapper.Save(spsDataSycnSetting);

                        obj.SyncDataSetting = spsDataSycnSetting;
                    }

                    obj.SyncDataSetting.SycnRetryTimes = Convert.ToInt32(txtSycnRetryTimes.Text);

                    obj.SyncDataSetting.SycnMO = fsSyncMO.Collapsed;

                    if (obj.SyncDataSetting.SycnMO.HasValue && obj.SyncDataSetting.SycnMO.Value)
                    {
                        obj.SyncDataSetting.SycnMOUrl           = txtSycnMOUrl.Text.Trim();
                        obj.SyncDataSetting.SycnMOOkMessage     = txtSycnMOOkMessage.Text.Trim();
                        obj.SyncDataSetting.SycnMOFailedMessage = txtSycnMOFailedMessage.Text.Trim();
                    }
                    else
                    {
                        obj.SyncDataSetting.SycnMOUrl           = "";
                        obj.SyncDataSetting.SycnMOOkMessage     = "";
                        obj.SyncDataSetting.SycnMOFailedMessage = "";
                    }

                    obj.SyncDataSetting.SycnMR = fsSyncMR.Collapsed;

                    if (obj.SyncDataSetting.SycnMR.HasValue && obj.SyncDataSetting.SycnMR.Value)
                    {
                        obj.SyncDataSetting.SycnMRUrl           = txtSycnMRUrl.Text.Trim();
                        obj.SyncDataSetting.SycnMROkMessage     = txtSycnMROkMessage.Text.Trim();
                        obj.SyncDataSetting.SycnMRFailedMessage = txtSycnMRFailedMessage.Text.Trim();
                    }
                    else
                    {
                        obj.SyncDataSetting.SycnMRUrl           = "";
                        obj.SyncDataSetting.SycnMROkMessage     = "";
                        obj.SyncDataSetting.SycnMRFailedMessage = "";
                    }

                    obj.SyncDataSetting.SycnSate = fsSyncState.Collapsed;

                    if (obj.SyncDataSetting.SycnSate.HasValue && obj.SyncDataSetting.SycnSate.Value)
                    {
                        obj.SyncDataSetting.SycnSateUrl           = txtSycnStateUrl.Text.Trim();
                        obj.SyncDataSetting.SycnSateOkMessage     = txtSycnStateOkMessage.Text.Trim();
                        obj.SyncDataSetting.SycnSateFailedMessage = txtSycnStateFailedMessage.Text.Trim();
                    }
                    else
                    {
                        obj.SyncDataSetting.SycnSateUrl           = "";
                        obj.SyncDataSetting.SycnSateOkMessage     = "";
                        obj.SyncDataSetting.SycnSateFailedMessage = "";
                    }

                    SPSDataSycnSettingWrapper.Save(obj.SyncDataSetting);
                }



                SPSClientWrapper.Update(obj);

                winSPSClientEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }