protected void gvProjectXMDeductionSetUpTypeCashBack_RowEditing(object sender, GridViewEditEventArgs e) { this.RowEditIndex = e.NewEditIndex; this.BindGrid(this.Master.PageIndex, this.Master.PageSize); int Id = 0; int.TryParse(this.gvProjectXMDeductionSetUpTypeCashBack.DataKeys[e.NewEditIndex].Value.ToString(), out Id); var row = this.gvProjectXMDeductionSetUpTypeCashBack.Rows[e.NewEditIndex]; var xMDeductionSetUp = base.XMDeductionSetUpService.GetXMDeductionSetUpById(Id); if (xMDeductionSetUp != null) { //平台类型 CodeControl ccPlatformTypeId = (CodeControl)row.FindControl("ccPlatformTypeId"); ccPlatformTypeId.SelectedValue = xMDeductionSetUp.PlatformTypeId.Value; //平台负责人 SelectSingleCustomerControl txtPlatformTypePersonId = (SelectSingleCustomerControl)row.FindControl("txtPlatformTypePersonId"); txtPlatformTypePersonId.SelectSingleCustomer = base.CustomerInfoService.GetCustomerInfoByID(xMDeductionSetUp.PlatformTypePersonId.Value); if (txtPlatformTypePersonId.SelectSingleCustomer != null) { txtPlatformTypePersonId.Value = txtPlatformTypePersonId.SelectSingleCustomer.FullName; } } }
protected void gvAdvanceApplicationDetail_RowEditing(object sender, GridViewEditEventArgs e) { this.RowEditIndex = e.NewEditIndex; BindGrid(); int Id = 0; int.TryParse(this.gvAdvanceApplicationDetail.DataKeys[e.NewEditIndex].Value.ToString(), out Id); var row = this.gvAdvanceApplicationDetail.Rows[e.NewEditIndex]; var advanceApplicationDetail = base.AdvanceApplicationDetailService.GetAdvanceApplicationDetailById(Id); if (advanceApplicationDetail != null) { //暂支类型 CodeControl ccAdvanceTypeId = (CodeControl)row.FindControl("ccAdvanceTypeId"); ccAdvanceTypeId.SelectedValue = advanceApplicationDetail.AdvanceTypeId.Value; //领/还款类型 CodeControl ccPayTypeId = (CodeControl)row.FindControl("ccPayTypeId"); ccPayTypeId.SelectedValue = advanceApplicationDetail.PayTypeId.Value; //领/还款人 SelectSingleCustomerControl txtRecipientsId = (SelectSingleCustomerControl)row.FindControl("txtRecipientsId"); txtRecipientsId.SelectSingleCustomer = base.CustomerInfoService.GetCustomerInfoByID(advanceApplicationDetail.RecipientsId.Value); if (txtRecipientsId.SelectSingleCustomer != null) { txtRecipientsId.Value = txtRecipientsId.SelectSingleCustomer.FullName; } } }
protected void gvXMProjectList_RowEditing(object sender, GridViewEditEventArgs e) { this.RowEditIndex = e.NewEditIndex; this.BindGrid(this.Master.PageIndex, this.Master.PageSize); int Id = 0; int.TryParse(this.gvXMProjectList.DataKeys[e.NewEditIndex].Value.ToString(), out Id); var row = this.gvXMProjectList.Rows[e.NewEditIndex]; var xMProject = base.XMProjectService.GetXMProjectById(Id); if (xMProject != null) { //负责人 SelectSingleCustomerControl txtcustomerId = (SelectSingleCustomerControl)row.FindControl("txtcustomerId"); if (xMProject.customerId != null) { txtcustomerId.SelectSingleCustomer = base.CustomerInfoService.GetCustomerInfoByID(xMProject.customerId.Value); if (txtcustomerId.SelectSingleCustomer != null) { txtcustomerId.Value = txtcustomerId.SelectSingleCustomer.FullName; } } //负责人 if (xMProject.ClientId != null) { SelectSingleCustomerControl txtClientId = (SelectSingleCustomerControl)row.FindControl("txtClientId"); txtClientId.SelectSingleCustomer = base.CustomerInfoService.GetCustomerInfoByID(xMProject.ClientId.Value); if (txtClientId.SelectSingleCustomer != null) { txtClientId.Value = txtClientId.SelectSingleCustomer.FullName; } } //项目类型 CodeControl ccProjectTypeId = (CodeControl)row.FindControl("ccProjectTypeId"); ccProjectTypeId.SelectedValue = xMProject.ProjectTypeId.Value; //所属部门 DropDownList ddlDepartment = (DropDownList)row.FindControl("ddlDepartment"); if (xMProject.DepartmentID != null) { ddlDepartment.SelectedValue = xMProject.DepartmentID.ToString(); } } }
/// <summary> /// 记录行 操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvXMProjectList_RowUpdating(object sender, GridViewUpdateEventArgs e) { int Id = 0; if (int.TryParse(this.gvXMProjectList.DataKeys[e.RowIndex].Value.ToString(), out Id)) { var row = this.gvXMProjectList.Rows[e.RowIndex]; #region 字符验证 //产品名称 var txtProjectName = row.FindControl("txtProjectName") as TextBox; var lblMsgProjectNameVaule = row.FindControl("lblMsgProjectNameVaule") as Label; var lblProjectName = row.FindControl("lblProjectName") as Label; var lblMsgShipmentProportionVaule = row.FindControl("lblMsgShipmentProportionVaule") as Label; var ccProjectTypeId = row.FindControl("ccProjectTypeId") as CodeControl; var chkIsEnable = row.FindControl("chkIsEnable") as CheckBox; var ddlDepartment = row.FindControl("ddlDepartment") as DropDownList; var ShipmentProportion = row.FindControl("txtShipmentProportion") as TextBox; decimal paramparse2 = 0; lblMsgProjectNameVaule.Text = ""; if (txtProjectName.Text.Trim() == "") { lblMsgProjectNameVaule.Text = "不允许为空"; } //负责人 SelectSingleCustomerControl txtcustomerId = (SelectSingleCustomerControl)row.FindControl("txtcustomerId"); //客户 SelectSingleCustomerControl txtClientId = (SelectSingleCustomerControl)row.FindControl("txtClientId"); //备注 var txtRemark = row.FindControl("txtRemark") as TextBox; if (lblMsgProjectNameVaule.Text != "") { return; } #endregion var xMProject = base.XMProjectService.GetXMProjectById(Id); var xMProjectList = base.XMProjectService.GetXMProjectList(txtProjectName.Text.Trim(), -1, -1); if (xMProject != null) { if ((!txtProjectName.Text.Trim().Equals(lblProjectName.Text.Trim())) && xMProjectList.Count > 0) { base.ShowMessage("该项目名称已存在"); return; } xMProject.ProjectName = txtProjectName.Text.Trim(); xMProject.ProjectTypeId = ccProjectTypeId.SelectedValue; xMProject.customerId = txtcustomerId.SelectSingleCustomer.CustomerID; if (decimal.TryParse(ShipmentProportion.Text.Trim(), out paramparse2)) { xMProject.ShipmentProportion = decimal.Parse(ShipmentProportion.Text.Trim()); } else { xMProject.ShipmentProportion = 0; } if (txtClientId != null) { if (txtClientId.SelectSingleCustomer != null) { xMProject.ClientId = txtClientId.SelectSingleCustomer.CustomerID; } } if (txtRemark.Text.Trim() != "") { xMProject.Remark = txtRemark.Text.Trim(); } else { xMProject.Remark = ""; } xMProject.DepartmentID = int.Parse(ddlDepartment.SelectedValue.Trim()); if (!chkIsEnable.Checked && (bool)xMProject.IsEnable) { var NickList = base.XMNickService.GetXMNickListByProjectId(xMProject.Id); if (NickList != null && NickList.Count > 0) { foreach (XMNick info in NickList) { info.isEnable = false; info.updatePerson = HozestERPContext.Current.User.CustomerID.ToString(); info.updateTime = DateTime.Now; base.XMNickService.UpdateXMNick(info); } } } xMProject.IsEnable = chkIsEnable.Checked;//是否在运营 xMProject.UpdateID = HozestERPContext.Current.User.CustomerID; xMProject.UpdateDate = DateTime.Now; base.XMProjectService.UpdateXMProject(xMProject); } else { if (xMProjectList.Count > 0) { base.ShowMessage("该项目名称已存在"); return; } xMProject = new XMProject(); xMProject.ProjectName = txtProjectName.Text.Trim(); xMProject.ProjectTypeId = ccProjectTypeId.SelectedValue; xMProject.customerId = txtcustomerId.SelectSingleCustomer.CustomerID; if (txtClientId != null) { if (txtClientId.SelectSingleCustomer != null) { xMProject.ClientId = txtClientId.SelectSingleCustomer.CustomerID; } } if (txtRemark.Text.Trim() != "") { xMProject.Remark = txtRemark.Text.Trim(); } else { xMProject.Remark = ""; } xMProject.DepartmentID = int.Parse(ddlDepartment.SelectedValue.Trim()); xMProject.IsEnable = chkIsEnable.Checked;//是否在运营 xMProject.CreateID = HozestERPContext.Current.User.CustomerID; xMProject.CreateDate = DateTime.Now; xMProject.UpdateID = HozestERPContext.Current.User.CustomerID; xMProject.UpdateDate = DateTime.Now; base.XMProjectService.InsertXMProject(xMProject); } // SelectSingleCustomer //this.SelectSingleCustomer = null; Session["OperationCustomerCustomerStatus"] = null; Session["OperationClientCustomerStatus"] = null; this.RowEditIndex = -1; this.BindGrid(this.Master.PageIndex, this.Master.PageSize); } }