protected void btnSaveSPCode_Click(object sender, DirectEventArgs e) { try { SPCodeWrapper obj = new SPCodeWrapper(); obj.Description = this.txtDescription.Text.Trim(); obj.ChannelID = ChannelID; obj.IsMatchCase = chkIsMatchCase.Checked; if (!chkIsMatchCase.Checked) { obj.Mo = this.txtMO.Text.Trim(); } else { obj.Mo = this.txtMO.Text; } obj.MOType = this.cmbCodeType.SelectedItem.Value; obj.MOLength = obj.Mo.Length; obj.MOType = this.cmbCodeType.SelectedItem.Value; obj.OrderIndex = 1; obj.SPCode = this.txtSPCode.Text.Trim(); obj.SPCodeType = "1"; obj.SPCodeLength = obj.SPCode.Length; obj.IsDiable = this.chkIsDiable.Checked; obj.LimitProvince = this.chkLimitProvince.Checked; obj.LimitProvinceArea = WebUIHelper.GetSelectMutilItems(this.mfLimitProvinceArea, ","); obj.HasPhoneLimit = this.chkHasPhoneLimit.Checked; obj.HasFilters = this.chkHasFilters.Checked; obj.HasParamsConvert = this.chkHasParamsConvert.Checked; obj.HasPhoneLimit = this.chkHasPhoneLimit.Checked; obj.Price = Convert.ToDecimal(this.nfPrice.Text.Trim()); obj.Description = this.txtDescription.Text.Trim(); //obj.SendText = this.txtCodeSendText.Text.Trim(); obj.Name = ChannelID.Name + "-" + obj.MoCode; obj.Code = ChannelID.Name + "-" + obj.MoCode; SPCodeWrapper.QuickAddCode(obj, this.txtSubCodes.Text); winSPCodeAdd.Hide(); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { if (X.IsAjaxRequest) { return; } SPCodeWrapper obj = CodeID; if (obj != null) { this.lblChannelName.Text = obj.ChannelID_Name; this.lblMoCodeCode.Text = obj.MoCode; this.lblAssignedClient.Text = obj.AssignedClientName; this.lblPrice.Text = obj.Price.ToString(); this.lblIsDiable.Text = obj.IsDiable.ToString(); this.lblProvinceLimitInfo.Text = obj.ProvinceLimitInfo.ToString(); this.lblPhoneLimitInfo.Text = obj.PhoneLimitInfo.ToString(); } }
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; } }
protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); storeSPCode.DataSource = SPCodeWrapper.FindAllByOrderBy(recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSPCode.DataBind(); }
public void Show(int id) { try { SPCodeWrapper obj = SPCodeWrapper.FindById(id); if (obj != null) { this.hidId.Text = obj.Id.ToString(); this.txtName.Text = ValueConvertUtil.ConvertStringValue(obj.Name); this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description); this.txtCode.Text = ValueConvertUtil.ConvertStringValue(obj.Code); this.txtMO.Text = ValueConvertUtil.ConvertStringValue(obj.Mo); this.cmbMOType.Value = ValueConvertUtil.ConvertStringValue(obj.MOType); this.numOrderIndex.Text = obj.OrderIndex.ToString(); this.txtSPCode.Text = ValueConvertUtil.ConvertStringValue(obj.SPCode); //if (!string.IsNullOrEmpty(obj.Province)) // WebUIHelper.SetSelectMutilItems(mcmbProvince, "|", obj.Province); //this.txtProvince.Text = obj.Province.ToString(); //this.txtDisableCity.Text = ValueConvertUtil.ConvertStringValue(obj.DisableCity); this.chkIsDiable.Checked = obj.IsDiable; //this.txtDayLimit.Text = obj.DayLimit.ToString(); //this.txtMonthLimit.Text = obj.MonthLimit.ToString(); this.txtPrice.Text = obj.Price.ToString(); //this.txtCodeSendText.Text = ValueConvertUtil.ConvertStringValue(obj.SendText); this.chkHasFilters.Checked = obj.HasFilters; this.chkHasParamsConvert.Checked = obj.HasParamsConvert; hidId.Text = id.ToString(); winSPCodeEdit.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 Page_Load(object sender, EventArgs e) { if (X.IsAjaxRequest) { return; } SPCodeWrapper obj = SPCodeWrapper.FindById(Convert.ToInt32(this.Request.QueryString["CodeID"])); if (obj != null) { this.hidSPCodeID.Text = obj.Id.ToString(); this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description); this.chkIsMatchCase.Checked = obj.IsMatchCase.HasValue && obj.IsMatchCase.Value; this.txtMO.Text = ValueConvertUtil.ConvertStringValue(obj.Mo); this.lblCodeType.Text = obj.MoCode; this.txtSPCode.Text = ValueConvertUtil.ConvertStringValue(obj.SPCode); this.chkIsDiable.Checked = obj.IsDiable; this.chkLimitProvince.Checked = obj.LimitProvince.HasValue && obj.LimitProvince.Value; if (obj.LimitProvince.HasValue && obj.LimitProvince.Value) { if (!string.IsNullOrEmpty(obj.LimitProvinceArea)) { WebUIHelper.SetSelectMutilItems(this.mfLimitProvinceArea, ",", obj.LimitProvinceArea); } } this.chkHasPhoneLimit.Checked = obj.HasPhoneLimit; this.chkHasFilters.Checked = obj.HasFilters; this.chkHasParamsConvert.Checked = obj.HasParamsConvert; if (obj.Price.HasValue) { this.nfPrice.Value = obj.Price; } else { this.nfPrice.Value = 0; } } }
public void Show(int id) { try { SPCodeWrapper obj = SPCodeWrapper.FindById(id); if (obj != null) { //this.lblID.Text = obj.ID.ToString(); this.lblName.Text = ValueConvertUtil.ConvertStringValue(obj.Name); this.lblDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description); this.lblCode.Text = ValueConvertUtil.ConvertStringValue(obj.Code); this.lblChannelID.Text = obj.ChannelID.ToString(); //this.lblMO.Text = ValueConvertUtil.ConvertStringValue(obj.MO); this.lblMOType.Text = ValueConvertUtil.ConvertStringValue(obj.MOType); this.lblOrderIndex.Text = obj.OrderIndex.ToString(); this.lblSPCode.Text = ValueConvertUtil.ConvertStringValue(obj.SPCode); //this.lblProvince.Text = ValueConvertUtil.ConvertStringValue(obj.Province); //this.lblDisableCity.Text = ValueConvertUtil.ConvertStringValue(obj.DisableCity); //this.lblIsDiable.Text = ValueConvertUtil.ConvertNullableValue<bool>(obj.IsDiable); //this.lblSPType.Text = ValueConvertUtil.ConvertStringValue(obj.SPType); //this.lblCodeLength.Text = obj.CodeLength.ToString(); //this.lblDayLimit.Text = obj.DayLimit.ToString(); //this.lblMonthLimit.Text = obj.MonthLimit.ToString(); this.lblPrice.Text = obj.Price.ToString(); //this.lblSendText.Text = ValueConvertUtil.ConvertStringValue(obj.SendText); //this.lblHasFilters.Text = ValueConvertUtil.ConvertNullableValue<bool>(obj.HasFilters); //hidLogID.Text = id.ToString(); winSPCodeView.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 storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e) { if (cmbChannel.SelectedItem != null) { this.storeSPCode.DataSource = SPCodeWrapper.GetAvaiableCodeForClient(SPChannelWrapper.FindById(Convert.ToInt32(cmbChannel.SelectedItem.Value)), SPSClientID); } else { this.storeSPCode.DataSource = new List <SPCodeWrapper>(); } this.storeSPCode.DataBind(); }
public void DeleteRecord(int id) { try { SPCodeWrapper.DeleteByID(id); ResourceManager.AjaxSuccess = true; } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = string.Format(ex.Message); return; } }
public void SaveClientCodeRelation() { SPCodeWrapper codeWrapper = SPCodeWrapper.FindById(Convert.ToInt32(cmbCode.SelectedItem.Value)); DateTime changeDate = System.DateTime.Now; int changeUserID = this.ParentPage.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(SPSClientID, changeDate, changeUserID, price, interceptRate, syncData, sycnNotInterceptCount, sycnRetryTimes, dataSycnSetting ); winSPClientCodeRelationAdd.Hide(); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message; } }
protected void btnSaveSPClientCodeRelation_Click(object sender, DirectEventArgs e) { SPCodeWrapper codeWrapper = SPCodeWrapper.FindById(Convert.ToInt32(cmbCode.SelectedItem.Value)); if (!string.IsNullOrEmpty(codeWrapper.AssignedClientName)) { X.Msg.Show(new MessageBoxConfig { Title = "警告", Message = string.Format("该代码已经分配给客户{0},确认转给客户{1}?", codeWrapper.AssignedClientName, SPSClientID.Name), Width = 300, Buttons = MessageBox.Button.OKCANCEL, Multiline = false, AnimEl = this.btnSavelSPClientCodeRelation.ClientID, Fn = new JFunction { Fn = "beforeSaveClientCodeRelation" } }); //X.Msg.Confirm("警告", string.Format("该代码已经分配给客户{0},确认转给客户{1}?", codeWrapper.AssignedClientName, SPSClientID.Name), new JFunction { Fn = "beforeSaveClientCodeRelation" }).Show(); return; } if (codeWrapper.AssignedClientName == SPSClientID.Name) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = string.Format("该代码已经分配给客户{0},不能重复分配", SPSClientID.Name); if (cmbChannel.SelectedItem != null) { this.storeSPCode.DataSource = SPCodeWrapper.GetAvaiableCodeForClient(SPChannelWrapper.FindById(Convert.ToInt32(cmbChannel.SelectedItem.Value)), SPSClientID); } else { this.storeSPCode.DataSource = new List <SPCodeWrapper>(); } this.storeSPCode.DataBind(); return; } SaveClientCodeRelation(); }
protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e) { SPChannelWrapper channel = null; if (this.cmbChannel.SelectedItem != null) { channel = SPChannelWrapper.FindById(Convert.ToInt32(this.cmbChannel.SelectedItem.Value)); } if (channel != null) { this.storeSPCode.DataSource = SPCodeWrapper.FindAllByChannelID(channel); } else { this.storeSPCode.DataSource = new List <SPCodeWrapper>(); } this.storeSPCode.DataBind(); }
private static void GenerateSubTreeNode(TreeNode mainNode, SPCodeWrapper spCodeWrapper, List <SPCodeWrapper> allcodes) { List <SPCodeWrapper> subcodes = spCodeWrapper.GetAllSubCode(allcodes); foreach (SPCodeWrapper subCode in subcodes) { TreeNode subNode = new TreeNode(); subNode.Text = subCode.MoCode; subNode.NodeID = "nod" + subCode.Id.ToString(); subNode.Icon = Icon.Script; subNode.CustomAttributes.Add(new ConfigItem("MoCode", subCode.MoCode, ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("ChannelName", subCode.ChannelID_Name, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("ChannelID", subCode.ChannelID.Id.ToString(), ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("AssignedClientName", subCode.AssignedClientName, ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("CodeID", subCode.Id.ToString(), ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("Disable", subCode.IsDiable.ToString(), ParameterMode.Value)); GenerateSubTreeNode(subNode, subCode, allcodes); mainNode.Nodes.Add(subNode); } }
private void BindData() { DataTable tb = SPDayReportWrapper.QueryChannelInvoiceReport(StartDate, EndDate, ChannelID, CodeID).Tables[0]; string channelName = "所有"; if (ChannelID.HasValue && ChannelID > 0) { channelName = "【" + SPChannelWrapper.FindById(ChannelID.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"), channelName, codeName); ReportViewHelper.BindDataTableToReport(rptvContainer, tb, "DataSet1", reportName); }
protected void btnSaveSPCode_Click(object sender, DirectEventArgs e) { try { SPCodeWrapper obj = SPCodeWrapper.FindById(int.Parse(hidId.Text.Trim())); obj.Id = Convert.ToInt32(this.hidId.Text.Trim()); obj.Name = this.txtName.Text.Trim(); obj.Description = this.txtDescription.Text.Trim(); obj.Code = this.txtCode.Text.Trim(); obj.Mo = this.txtMO.Text.Trim(); obj.MOType = this.cmbMOType.SelectedItem.Value; obj.OrderIndex = Convert.ToInt32(this.numOrderIndex.Text.Trim()); obj.SPCode = this.txtSPCode.Text.Trim(); //obj.Province = this.txtProvince.Text.Trim(); //obj.DisableCity = this.txtDisableCity.Text.Trim(); obj.IsDiable = this.chkIsDiable.Checked; //obj.CodeLength = obj.Mo.Length; //obj.DayLimit = this.txtDayLimit.Text.Trim(); //obj.MonthLimit = this.txtMonthLimit.Text.Trim(); obj.Price = Convert.ToDecimal(this.txtPrice.Text.Trim()); //obj.SendText = this.txtCodeSendText.Text.Trim(); obj.HasFilters = this.chkHasFilters.Checked; obj.HasParamsConvert = this.chkHasParamsConvert.Checked; SPCodeWrapper.Update(obj); winSPCodeEdit.Hide(); ResourceManager.AjaxSuccess = true; } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message; return; } }
protected void btnSaveSPCode_Click(object sender, DirectEventArgs e) { try { SPCodeWrapper obj = new SPCodeWrapper(); obj.Name = ChannelID.Name + "-" + this.txtMO.Text.Trim() + "-" + this.txtSPCode.Text.Trim() + "-" + this.cmbMOType.SelectedItem.Value; obj.Code = ChannelID.Name + "-" + this.txtMO.Text.Trim() + "-" + this.txtSPCode.Text.Trim() + "-" + this.cmbMOType.SelectedItem.Value; obj.Description = this.txtDescription.Text.Trim(); obj.ChannelID = ChannelID; obj.Mo = this.txtMO.Text.Trim(); obj.MOType = this.cmbMOType.SelectedItem.Value; obj.OrderIndex = Convert.ToInt32(this.numOrderIndex.Text.Trim()); obj.SPCode = this.txtSPCode.Text.Trim(); //obj.Province = this.txtProvince.Text.Trim(); //obj.DisableCity = this.txtDisableCity.Text.Trim(); obj.IsDiable = false; //obj.SPType = "1"; //obj.CodeLength = obj.Mo.Length; //obj.DayLimit = this.txtDayLimit.Text.Trim() ; //obj.MonthLimit = this.txtMonthLimit.Text.Trim(); obj.Price = Convert.ToDecimal(this.txtPrice.Text.Trim()); //obj.SendText = this.txtCodeSendText.Text.Trim(); obj.HasFilters = this.chkHasFilters.Checked; obj.HasParamsConvert = this.chkHasParamsConvert.Checked; SPCodeWrapper.QuickAddCode(obj, this.chkHasSubCode.Checked, this.txtSubCode.Text.Trim()); winSPCodeAdd.Hide(); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message; } }
public string GetTreeNodes(string searchfilters) { Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection(); Ext.Net.TreeNode root = new Ext.Net.TreeNode(); root.Text = "root"; root.Icon = Icon.Folder; nodes.Add(root); List <SPCodeWrapper> allcodes = null; Dictionary <string, string> search = null; if (!string.IsNullOrEmpty(searchfilters)) { search = JSON.Deserialize <Dictionary <string, string> >(searchfilters); } int? channelID = null; int? clientID = null; string mo = string.Empty; string spnumber = string.Empty; if (search != null) { if (!string.IsNullOrEmpty(search["ChannelID"])) { channelID = Convert.ToInt32(search["ChannelID"]); } if (!string.IsNullOrEmpty(search["ClientID"])) { clientID = Convert.ToInt32(search["ClientID"]); } if (!string.IsNullOrEmpty(search["Mo"])) { mo = search["Mo"]; } if (!string.IsNullOrEmpty(search["SpNumber"])) { spnumber = search["SpNumber"]; } } if (ChannelID != null) { allcodes = SPCodeWrapper.FindAllByChannelIDAndClientIDAndMoAndSpNumber(ChannelID.Id, null, mo, spnumber); } else { allcodes = SPCodeWrapper.FindAllByChannelIDAndClientIDAndMoAndSpNumber(channelID, clientID, mo, spnumber); } for (int i = 0; i < allcodes.Count; i++) { if (allcodes[i].GetParentCode(allcodes) == allcodes[i]) { Ext.Net.TreeNode mainNode = new Ext.Net.TreeNode(); mainNode.Text = allcodes[i].MoCode; mainNode.NodeID = "nod" + allcodes[i].Id.ToString(); mainNode.Icon = Icon.Script; mainNode.CustomAttributes.Add(new ConfigItem("MoCode", allcodes[i].MoCode, ParameterMode.Value)); //if (ChannelID == null) mainNode.CustomAttributes.Add(new ConfigItem("ChannelName", allcodes[i].ChannelID_Name, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("ChannelID", allcodes[i].ChannelID.Id.ToString(), ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("AssignedClientName", allcodes[i].AssignedClientName, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("CodeID", allcodes[i].Id.ToString(), ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("Disable", allcodes[i].IsDiable.ToString(), ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("HasPhoneLimit", allcodes[i].HasPhoneLimit.ToString(), ParameterMode.Value)); GenerateSubTreeNode(mainNode, allcodes[i], allcodes); root.Nodes.Add(mainNode); } } return(nodes.ToJson()); }
protected void btnSaveSPCodeLimitSetting_Click(object sender, DirectEventArgs e) { try { SPCodeWrapper code = CodeID; code.IsDayTimeLimit = chkIsDayTimeLimit.Checked; code.HasDayMonthLimit = chkDayMonthTotalLimit.Checked; code.HasDayTotalLimit = chkDayTotalLimit.Checked; if (chkIsDayTimeLimit.Checked) { if (!string.IsNullOrEmpty(tfDayTimeLimitRangeStart.Text)) { CodeID.DayTimeLimitRangeStart = new DateTime(2013, 1, 1, Convert.ToInt32(tfDayTimeLimitRangeStart.Text.Split(':')[0]), Convert.ToInt32(tfDayTimeLimitRangeStart.Text.Split(':')[1]), 0); } else { CodeID.DayTimeLimitRangeStart = new DateTime(2013, 1, 1, 0, 0, 0); } if (!string.IsNullOrEmpty(tfDayTimeLimitRangeEnd.Text)) { CodeID.DayTimeLimitRangeEnd = new DateTime(2013, 1, 1, Convert.ToInt32(tfDayTimeLimitRangeEnd.Text.Split(':')[0]), Convert.ToInt32(tfDayTimeLimitRangeEnd.Text.Split(':')[1]), 0); } else { CodeID.DayTimeLimitRangeEnd = new DateTime(2013, 1, 1, 0, 0, 0); } } else { CodeID.DayTimeLimitRangeStart = new DateTime(2013, 1, 1, 0, 0, 0); CodeID.DayTimeLimitRangeEnd = new DateTime(2013, 1, 1, 0, 0, 0); } if (chkDayMonthTotalLimit.Checked) { CodeID.PhoneLimitDayCount = Convert.ToInt32(nfPhoneLimitDayCount.Value); CodeID.PhoneLimitMonthCount = Convert.ToInt32(nfPhoneLimitMonthCount.Value); } else { CodeID.PhoneLimitDayCount = 0; CodeID.PhoneLimitMonthCount = 0; } if (chkDayTotalLimit.Checked) { CodeID.DayTotalLimitCount = Convert.ToInt32(nfDayTotalLimit.Value); } else { CodeID.DayTotalLimitCount = 0; } if (CodeID.LimitProvince.HasValue && CodeID.LimitProvince.Value) { CodeID.DayTotalLimitInProvince = !fsLimitProvince.Collapsed; CodeID.DayTotalLimitInProvinceAssignedCount = hidAreaCountList.Text; } SPCodeWrapper.Update(CodeID); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message; return; } }
protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e) { //storeData.DataSource = new List<SPRecordWrapper>(); //storeData.DataBind(); PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this. PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); SPChannelWrapper channel = null; SPSClientWrapper client = this.Client; SPCodeWrapper code = null; if (this.cmbCode.SelectedItem != null) { code = SPCodeWrapper.FindById(Convert.ToInt32(this.cmbCode.SelectedItem.Value)); } DateTime?startDate = null; if (this.dfStart.SelectedValue != null) { startDate = this.dfStart.SelectedDate; } DateTime?endDate = null; if (this.dfEnd.SelectedValue != null) { endDate = this.dfEnd.SelectedDate; } List <QueryFilter> queryFilters = new List <QueryFilter>(); if (!string.IsNullOrEmpty(this.txtPhoneNumber.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MOBILE, this.txtPhoneNumber.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtLinkID.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_LINKID, this.txtLinkID.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtSpNumber.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_SPNUMBER, this.txtSpNumber.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtMo.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MO, this.txtMo.Text.Trim(), FilterFunction.StartsWith)); } queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISINTERCEPT, (false).ToString(), FilterFunction.EqualTo)); queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSTATOK, (true).ToString(), FilterFunction.EqualTo)); //if (this.cmbSycnStatus.SelectedItem != null && this.cmbSycnStatus.SelectedItem.Value != null) //{ // 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) { 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) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_OPERATORTYPE, this.cmbOperateType.SelectedItem.Value.ToString(), FilterFunction.EqualTo)); } storeData.DataSource = SPRecordWrapper.QueryRecordByPage(channel, code, client, SPRecordWrapper.DayReportType_AllUp, startDate, endDate, queryFilters, recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeData.DataBind(); }
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(); }
protected void btnSaveSPCode_Click(object sender, DirectEventArgs e) { try { SPCodeWrapper obj = SPCodeWrapper.FindById(int.Parse(hidSPCodeID.Text.Trim())); obj.Description = this.txtDescription.Text.Trim(); obj.IsMatchCase = chkIsMatchCase.Checked; if (!chkIsMatchCase.Checked) { obj.Mo = this.txtMO.Text.Trim(); } else { obj.Mo = this.txtMO.Text; } obj.MOLength = obj.Mo.Length; obj.SPCode = this.txtSPCode.Text.Trim(); obj.SPCodeLength = obj.SPCode.Length; obj.IsDiable = this.chkIsDiable.Checked; obj.LimitProvince = this.chkLimitProvince.Checked; string oldLimitProvinceArea = obj.LimitProvinceArea; obj.LimitProvinceArea = WebUIHelper.GetSelectMutilItems(this.mfLimitProvinceArea, ","); if (obj.LimitProvinceArea != oldLimitProvinceArea) { List <PhoneLimitAreaAssigned> phoneLimitAreas = new List <PhoneLimitAreaAssigned>(); string[] provinces = obj.LimitProvinceArea.Split((",").ToCharArray()); foreach (string province in provinces) { phoneLimitAreas.Add(new PhoneLimitAreaAssigned() { AreaName = province, LimitCount = 0 }); } obj.DayTotalLimitInProvinceAssignedCount = SerializeUtil.ToJson(phoneLimitAreas); } obj.HasPhoneLimit = this.chkHasPhoneLimit.Checked; obj.HasFilters = this.chkHasFilters.Checked; obj.HasParamsConvert = this.chkHasParamsConvert.Checked; obj.HasPhoneLimit = this.chkHasPhoneLimit.Checked; obj.Price = Convert.ToDecimal(this.nfPrice.Text.Trim()); SPCodeWrapper.Update(obj); ResourceManager.AjaxSuccess = true; } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message; } }
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 SaveClientCodeRelation() { SPCodeWrapper codeWrapper = SPCodeWrapper.FindById(Convert.ToInt32(cmbCode.SelectedItem.Value)); if (codeWrapper.ClientCodeRelation != null) { if (codeWrapper.ClientCodeRelation.ClientID.Id == SPSClientID.Id) { return; } codeWrapper.ClientCodeRelation.IsEnable = false; codeWrapper.ClientCodeRelation.EndDate = System.DateTime.Now; SPClientCodeRelationWrapper.Update(codeWrapper.ClientCodeRelation); } try { SPClientCodeRelationWrapper obj = new SPClientCodeRelationWrapper(); obj.Price = Convert.ToDecimal(this.txtPrice.Text.Trim()); obj.InterceptRate = Convert.ToDecimal(this.txtInterceptRate.Text.Trim()); obj.UseClientDefaultSycnSetting = false; obj.SyncData = this.chkSyncData.Checked; obj.ClientID = SPSClientID; obj.CodeID = codeWrapper; obj.SycnRetryTimes = this.txtSycnRetryTimes.Text.Trim(); if (obj.SyncData) { SPSDataSycnSettingWrapper spsDataSycnSetting = new SPSDataSycnSettingWrapper(); spsDataSycnSetting.SycnMO = true; spsDataSycnSetting.SyncType = "1"; spsDataSycnSetting.SycnMOUrl = this.txtSycnDataUrl.Text.Trim(); spsDataSycnSetting.SycnMOOkMessage = this.txtSycnOkMessage.Text.Trim(); spsDataSycnSetting.SycnMOFailedMessage = this.txtSycnFailedMessage.Text.Trim(); SPSDataSycnSettingWrapper.Save(spsDataSycnSetting); obj.SyncDataSetting = spsDataSycnSetting; } obj.StartDate = System.DateTime.Now; obj.EndDate = null; obj.IsEnable = true; obj.SycnNotInterceptCount = Convert.ToInt32(this.txtSycnNotInterceptCount.Text.Trim()); obj.CreateBy = this.ParentPage.CurrentLoginUser.UserID; obj.CreateAt = System.DateTime.Now; obj.LastModifyBy = this.ParentPage.CurrentLoginUser.UserID; obj.LastModifyAt = System.DateTime.Now; SPClientCodeRelationWrapper.Save(obj); winSPClientCodeRelationAdd.Hide(); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message; } }
private static void GenerateSubTreeNode(TreeNode mainNode, SPCodeWrapper spCodeWrapper, List<SPCodeWrapper> allcodes) { List<SPCodeWrapper> subcodes = spCodeWrapper.GetAllSubCode(allcodes); foreach (SPCodeWrapper subCode in subcodes) { TreeNode subNode = new TreeNode(); subNode.Text = subCode.MoCode; subNode.NodeID = "nod" + subCode.Id.ToString(); subNode.Icon = Icon.Script; subNode.CustomAttributes.Add(new ConfigItem("MoCode", subCode.MoCode, ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("ChannelName", subCode.ChannelID_Name, ParameterMode.Value)); mainNode.CustomAttributes.Add(new ConfigItem("ChannelID", subCode.ChannelID.Id.ToString(), ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("AssignedClientName", subCode.AssignedClientName, ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("CodeID", subCode.Id.ToString(), ParameterMode.Value)); subNode.CustomAttributes.Add(new ConfigItem("Disable", subCode.IsDiable.ToString(), ParameterMode.Value)); GenerateSubTreeNode(subNode, subCode, allcodes); mainNode.Nodes.Add(subNode); } }