private void BindData() { SVM_InventoryDifferencesBLL bll = new SVM_InventoryDifferencesBLL((int)ViewState["InventoryID"]); ViewState["ClientID"] = bll.Model.Client; ViewState["IsCXP"] = bll.Model["IsCXP"] == "1"; UC_DetailView1.BindData(bll.Model); UC_DetailView1.SetControlsEnable(false); #region 根据状态设定界面控件可见属性 if (bll.Model.ApproveFlag == 1 || bll.Model["SubmitFlag"] == "1") { gv_List.SetControlsEnable(false); cb_OnlyDisplayUnZero.Checked = true; bt_Save.Visible = false; bt_Submit.Visible = false; bt_Del.Visible = false; tb_AddProduct.Visible = false; bt_Submit.Visible = false; if (bll.Model.ApproveFlag == 1) { bt_Approve.Visible = false; //未提交 } } else { bt_Del.Visible = (int)Session["UserID"] == bll.Model.InsertStaff; bt_Approve.Visible = false; } #endregion ComputDiffInfo(bll); BindGrid(); }
protected void Page_Load(object sender, EventArgs e) { ddl_BasePayMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_BasePayMode"); ddl_BasePaySubsidyMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_BasePaySubsidyMode"); ddl_MinimumWageMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_MinimumWageMode"); ddl_InsuranceMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_InsuranceMode"); ddl_SeniorityPayMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_SeniorityPayMode"); ddl_SalesType = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_SalesType"); ddl_BankType = DV_pm.FindControl("PM_Promotor_BankType") == null ? null : (DropDownList)UC_DetailView1.FindControl("PM_Promotor_BankType"); txt_BankName = DV_pm.FindControl("PM_Promotor_BankName") == null ? null : (TextBox)UC_DetailView1.FindControl("PM_Promotor_BankName"); if (ddl_BankType != null) { ddl_BankType.AutoPostBack = true; ddl_BankType.SelectedIndexChanged += new EventHandler(ddl_BankType_SelectedIndexChanged); } ddl_BasePaySubsidyMode.AutoPostBack = true; ddl_BasePaySubsidyMode.SelectedIndexChanged += new EventHandler(ddl_BasePaySubsidyMode_SelectedIndexChanged); ddl_MinimumWageMode.AutoPostBack = true; ddl_MinimumWageMode.SelectedIndexChanged += new EventHandler(ddl_MinimumWageMode_SelectedIndexChanged); ddl_InsuranceMode.AutoPostBack = true; ddl_InsuranceMode.SelectedIndexChanged += new EventHandler(ddl_InsuranceMode_SelectedIndexChanged); txt_AvgSales = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_AvgSales"); txt_BaseFeeRate = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_BaseFeeRate"); txt_FloatingTarget = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_FloatingTarget"); Page.ClientScript.RegisterClientScriptInclude("meizzDate", Page.ResolveClientUrl("~/App_Themes/basic/meizzDate.js")); if (!IsPostBack) { txt_AvgSales.Enabled = false; txt_BaseFeeRate.Enabled = false; txt_FloatingTarget.Enabled = false; ddl_SalesType.Enabled = false; ddl_BasePaySubsidyMode.Enabled = false; ddl_MinimumWageMode.Enabled = false; txt_FloatingTarget.Text = "0"; txt_AvgSales.Text = "0"; txt_BaseFeeRate.Text = "0"; ViewState["PromotorID"] = Request.QueryString["PromotorID"] == null ? 0 : int.Parse(Request.QueryString["PromotorID"]); //新增薪资标准 #region 判断当前导购是否有所在工作的门店 if (PM_PromotorInRetailerBLL.GetModelList("Promotor=" + ViewState["PromotorID"].ToString()).Count == 0) { MessageBox.ShowAndRedirect(this, "请设置该导购员所在的门店!", "PM_PromotorDetail.aspx?PromotorID=" + ViewState["PromotorID"].ToString()); return; } #endregion PM_Promotor m = new PM_PromotorBLL((int)ViewState["PromotorID"]).Model; if (m != null) { DV_pm.BindData(m); } else { MessageBox.ShowAndClose(this, "导购员信息读取失败!"); return; } DropDownList ddl_Classfiy = DV_pm.FindControl("PM_Promotor_Classfiy") as DropDownList; TextBox tbx_BeginWorkDate = DV_pm.FindControl("PM_Promotor_BeginWorkDate") as TextBox; int classfiy = 0; int.TryParse(m["Classfiy"], out classfiy); if (classfiy == 0) { MessageBox.ShowAndClose(this, "导购员类别读取失败!"); return; } if (m["State"] == "2") { MessageBox.ShowAndClose(this, "导购有流程正在审批,无法再发起流程!"); return; } else if (classfiy == 1 || classfiy == 2) { ddl_Classfiy.Items.FindByValue("1").Enabled = false; ddl_Classfiy.Items.FindByValue("2").Enabled = false; } else { ddl_Classfiy.Items.FindByValue("6").Enabled = false; } tbx_BeginWorkDate.Text = ""; BindData(classfiy); } }
protected void Button1_Click(object sender, EventArgs e) { PM_PromotorBLL _promotor = new PM_PromotorBLL((int)ViewState["PromotorID"]); if (_promotor.Model["State"] == "2") { MessageBox.Show(this, "该导购有未完成的流程,请待流程完成后,再做调整!"); return; } DropDownList ddl_Classfiy = DV_pm.FindControl("PM_Promotor_Classfiy") as DropDownList; TextBox tbx_BeginWorkDate = DV_pm.FindControl("PM_Promotor_BeginWorkDate") as TextBox; TextBox tbx_Remark = DV_pm.FindControl("PM_Promotor_Education") as TextBox; TextBox tbx_AccountNO = (TextBox)DV_pm.FindControl("PM_Promotor_AccountCode"); if (ddl_BankType.SelectedValue == "0" || txt_BankName.Text.Trim() == "") { MessageBox.Show(this, "请选择开户行!"); return; } if (ddl_Classfiy.SelectedValue != "0" && tbx_BeginWorkDate.Text.Trim() != "") { int budget = PM_PromotorNumberLimitBLL.CheckOverBudget(_promotor.Model.OrganizeCity, int.Parse(_promotor.Model["Classfiy"])); NameValueCollection dataobjects = new NameValueCollection(); dataobjects.Add("ID", ViewState["PromotorID"].ToString()); dataobjects.Add("OrganizeCity", _promotor.Model.OrganizeCity.ToString()); dataobjects.Add("BeginWorkDate", tbx_BeginWorkDate.Text.ToString()); dataobjects.Add("Classify", ddl_Classfiy.SelectedValue); dataobjects.Add("Remark", tbx_Remark.Text); dataobjects.Add("PM_Name", _promotor.Model.Name.ToString()); dataobjects.Add("BankType", ddl_BankType.SelectedValue); dataobjects.Add("BankName", txt_BankName.Text.Trim()); dataobjects.Add("AccountNO", tbx_AccountNO.Text.Trim()); PM_PromotorSalaryBLL bll = new PM_PromotorSalaryBLL(); UC_DetailView1.GetData(bll.Model); #region 数据录入判断 if (bll.Model.BasePayMode == 0) { MessageBox.Show(this, "请选择正确的底薪模式!"); return; } if (bll.Model.BasePayMode == 1) { if (bll.Model.SeniorityPayMode == 0) { MessageBox.Show(this, "当底薪模式为固定底薪时,必须选择工龄工资模式!"); return; } if (bll.Model.InsuranceMode == 0) { MessageBox.Show(this, "当底薪模式为固定底薪时,必须选择社保!"); return; } } if (bll.Model.BasePaySubsidyMode != 0 && bll.Model.BasePaySubsidy == 0) { MessageBox.Show(this, "当选择了底薪补贴类型时,请设定补贴金额!"); return; } if (bll.Model.BasePaySubsidyMode != 0 && bll.Model.BasePaySubsidyBeginDate.Year == 1900) { MessageBox.Show(this, "当选择了底薪补贴类型时,请设定底薪补贴起始日期!"); return; } if (bll.Model.BasePaySubsidyMode == 1 && bll.Model.BasePaySubsidyEndDate.Year == 1900) { MessageBox.Show(this, "当选择了底薪补贴类型为临时补贴时,请设定底薪补贴截止日期!"); return; } if (bll.Model.MinimumWageMode == 2 && bll.Model.MinimumWage == 0) { MessageBox.Show(this, "当选择了特殊保底时,请设定保底金额!"); return; } if (bll.Model.MinimumWageMode != 0 && bll.Model.MinimumWageBeginDate.Year == 1900) { MessageBox.Show(this, "当选择了薪资保底时,请设定保底的起始日期!"); return; } if (bll.Model.MinimumWageMode != 0 && bll.Model.MinimumWageEndDate.Year == 1900) { MessageBox.Show(this, "当选择了薪资保底时,请设定保底的截止日期!"); return; } if (bll.Model.InsuranceMode == 0 && bll.Model.BasePayMode != 3) { MessageBox.Show(this, "非兼职,请选择正确的社保模式!"); return; } if (bll.Model.InsuranceMode == 1 && bll.Model.InsuranceSubsidy <= 0) { MessageBox.Show(this, "请正确输入保险补贴金额!"); return; } if (bll.Model.BasePayMode == 4 && bll.Model["FloatingTarget"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(非华南)时,请设定浮动底薪上限任务量!"); return; } if (bll.Model.BasePayMode == 4 && bll.Model["AvgSales"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(非华南)时,请设定前两月平均销量!"); return; } if (bll.Model.BasePayMode == 5 && bll.Model["SalesType"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(华南)时,请设定实销类别!"); return; } if (bll.Model.BasePayMode == 5 && bll.Model["BaseFeeRate"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(华南)时,请设定底薪费率!"); return; } #endregion int TaskID = EWF_TaskBLL.NewTask("PMClassify_Change", (int)Session["UserID"], "导购员类型变更流程,姓名:" + _promotor.Model.Name, "~/SubModule/PM/PM_PromotorDetail.aspx?PromotorID=" + ViewState["PromotorID"].ToString(), dataobjects); if (TaskID > 0) { bll.Model.Promotor = (int)ViewState["PromotorID"]; bll.Model.State = 2; bll.Model.ApproveTask = TaskID; bll.Model.ApproveFlag = 2; bll.Model.InsertStaff = (int)Session["UserID"]; bll.Add(); _promotor.Submit(TaskID, (int)Session["UserID"]); new EWF_TaskBLL(TaskID).Start(); MessageBox.ShowAndClose(this, "流程发起成功!"); } } }
private void BindData(int classfiy) { PM_Promotor p = new PM_PromotorBLL((int)ViewState["PromotorID"]).Model; #region 获取当前导购标准薪资、保底薪资、导购管理费 if ((int)ViewState["PromotorID"] > 0) { decimal basepay = 0, minumumwage = 0, rtmanagecost = 0; new PM_PromotorBLL((int)ViewState["PromotorID"]).GetStdPay(out basepay, out minumumwage, out rtmanagecost); ViewState["BasePay"] = basepay; ViewState["MinumumWage"] = minumumwage; ViewState["RTManageCost"] = rtmanagecost; } #endregion PM_PromotorSalary m = new PM_PromotorSalary(); m.Promotor = (int)ViewState["PromotorID"]; m.State = 1; m.InsertStaff = (int)Session["UserID"]; m.RTManageCost = (decimal)ViewState["RTManageCost"]; ddl_BasePayMode.Enabled = false; if (classfiy == 1 || classfiy == 2) { m.BasePayMode = 3; } else { m.SeniorityPayMode = 1; ddl_BankType.Items[3].Enabled = false; #region 抓取固定底薪标准 decimal basepay = (decimal)ViewState["BasePay"]; m.BasePay = basepay; #endregion Addr_OrganizeCityBLL _bll = new Addr_OrganizeCityBLL(p.OrganizeCity); if (_bll.IsChildOrganizeCity(7))//判断是否为华南区 { ddl_BasePayMode.Items.Remove(new ListItem("浮动底薪(非华南)", "4")); ddl_BasePayMode.Items.Remove(new ListItem("兼职底薪", "3")); ddl_BasePayMode.Enabled = true; ddl_SalesType.Enabled = true; txt_BaseFeeRate.Enabled = true; } else { m.BasePayMode = 1; } } UC_DetailView1.BindData(m); if (m.RTManageCost > 0 && (decimal)ViewState["RTManageCost"] == m.RTManageCost) { TextBox tbx = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_RTManageCost"); if (tbx != null) { tbx.Enabled = false; } } if (m.State < 3) { #region 兼职导购的限定 try { if (classfiy != 1 && classfiy != 2) //非专职、非流导,认为是兼职导购 { DateTime Birthday; if (DateTime.TryParse(p["Birthday"], out Birthday) && Birthday.AddYears(49) < DateTime.Now) { foreach (ListItem item in ddl_InsuranceMode.Items) { if (item.Value != "5" && item.Value != "8" && item.Value != "0") { item.Enabled = false; } } } SetControlsEnable(true); } else { SetControlsEnable(false); } } catch { } #endregion ddl_BasePaySubsidyMode_SelectedIndexChanged(null, null); ddl_InsuranceMode_SelectedIndexChanged(null, null); ddl_MinimumWageMode_SelectedIndexChanged(null, null); ddl_BankType_SelectedIndexChanged(null, null); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]); ViewState["ClientID"] = Request.QueryString["ClientID"] == null ? 0 : int.Parse(Request.QueryString["ClientID"]); if ((int)ViewState["ID"] == 0) { if (ViewState["ClientID"] != null) { CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]); MCSSelectControl select_Client = UC_DetailView1.FindControl("FNA_ClientPaymentForcast_Client") == null ? null : (MCSSelectControl)UC_DetailView1.FindControl("FNA_ClientPaymentForcast_Client"); if (select_Client != null) { select_Client.SelectValue = ViewState["ClientID"].ToString(); select_Client.SelectText = client.Model.FullName; select_Client.Enabled = false; } } bt_Approve.Visible = false; btn_CancleApprove.Visible = false; } else { BindData(); } } }
private void BindData() { FNA_ClientPaymentInfo m = new FNA_ClientPaymentInfoBLL((int)ViewState["ID"]).Model; UploadFile1.RelateID = (int)ViewState["ID"]; UploadFile1.BindGrid(); UC_DetailView1.BindData(m); if (m.ApproveFlag == 1) { UC_DetailView1.SetControlsEnable(false); bt_Save.Visible = false; bt_Approve.Visible = false; UploadFile1.CanDelete = false; } else { btn_CanclePass.Visible = false; } DropDownList ddl_PayType = UC_DetailView1.FindControl("FNA_ClientPaymentInfo_PayType") == null ? null : (DropDownList)UC_DetailView1.FindControl("FNA_ClientPaymentInfo_PayType"); if (ddl_PayType != null) { ddl_PayType_SelectedIndexChanged(ddl_PayType, null); } }
void ddl_BasePayMode_SelectedIndexChanged(object sender, EventArgs e) { TextBox tbx_BasePay = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_BasePay"); if (tbx_BasePay == null) { return; } if (ddl_BasePayMode.SelectedValue == "1" || ddl_BasePayMode.SelectedValue == "4" || ddl_BasePayMode.SelectedValue == "5") { #region 抓取固定底薪标准 decimal basepay = (decimal)ViewState["BasePay"]; tbx_BasePay.Text = basepay.ToString("0.##"); tbx_BasePay.Enabled = false; #endregion SetControlsEnable(true); //if (ddl_InsuranceMode != null) //{ // ddl_InsuranceMode.Items.FindByValue("1").Enabled = true; // ddl_InsuranceMode_SelectedIndexChanged(null, null); //} switch (ddl_BasePayMode.SelectedValue) { case "1": setdisabledfloatingcontorl(false); break; case "4": if ((int)ViewState["PromotorSalaryID"] == 0) { txt_AvgSales.Text = ((decimal)ViewState["AvgSales"]).ToString("0.##"); txt_BaseFeeRate.Text = ((decimal)ViewState["BaseFeeRate"]).ToString("0.##"); } txt_FloatingTarget.Enabled = true; ddl_SalesType.Enabled = false; txt_AvgSales.Enabled = false; txt_BaseFeeRate.Enabled = false; //chk_arrivetarget.Enabled = false;//20130313 chk_arrivetarget.Enabled = true; //IList<PM_PromotorSalary> pmsalary = PM_PromotorSalaryBLL.GetModelList("State=3 AND Promotor=" + ViewState["PromotorID"].ToString()); //if (pmsalary.Count != 0) //{ // chk_arrivetarget.Checked = pmsalary[0]["ISArriveTarget"] == "1"; //} break; case "5": txt_FloatingTarget.Enabled = false; txt_AvgSales.Enabled = false; txt_BaseFeeRate.Enabled = true; ddl_SalesType.Enabled = true; break; } } else { setdisabledfloatingcontorl(false); tbx_BasePay.Text = "0"; //非固定底薪,底薪标准字段为0 tbx_BasePay.Enabled = false; if (ddl_BasePayMode.SelectedValue == "3") { SetControlsEnable(false); } //兼职底职无社保补贴项 if (ddl_InsuranceMode != null) { if (ddl_InsuranceMode.SelectedValue == "1") { ddl_InsuranceMode.SelectedValue = "0"; } // ddl_InsuranceMode.Items.FindByValue("1").Enabled = false; ddl_InsuranceMode_SelectedIndexChanged(null, null); } } }
protected void Page_Load(object sender, EventArgs e) { DropDownList ddl_PayType = UC_DetailView1.FindControl("FNA_ClientPaymentInfo_PayType") == null ? null : (DropDownList)UC_DetailView1.FindControl("FNA_ClientPaymentInfo_PayType"); if (ddl_PayType != null) { ddl_PayType.SelectedIndexChanged += new EventHandler(ddl_PayType_SelectedIndexChanged); ddl_PayType.AutoPostBack = true; } if (!IsPostBack) { ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]); if ((int)ViewState["ID"] == 0) { if (Request.QueryString["ClientID"] != null) { ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]); Session["ClientID"] = ViewState["ClientID"]; } else if (Session["ClientID"] != null) { ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString()); } if (ViewState["ClientID"] != null) { CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]); MCSSelectControl select_Client = (MCSSelectControl)UC_DetailView1.FindControl("FNA_ClientPaymentInfo_Client"); select_Client.SelectValue = ViewState["ClientID"].ToString(); select_Client.SelectText = client.Model.FullName; select_Client.Enabled = false; } TextBox tbx_ConfirmDate = (TextBox)UC_DetailView1.FindControl("FNA_ClientpaymentInfo_ConfirmDate"); bt_Approve.Visible = false; btn_CanclePass.Visible = false; UploadFile1.Visible = false; } else { BindData(); } } }
protected void txt_IDCode_TextChanged(object sender, EventArgs e) { DateTime BirthDay; int Sex; TextBox txt_birthday = UC_DetailView1.FindControl("PM_Promotor_Birthday") != null ? (TextBox)UC_DetailView1.FindControl("PM_Promotor_Birthday") : null; DropDownList ddl_sex = UC_DetailView1.FindControl("PM_Promotor_Sex") != null ? (DropDownList)UC_DetailView1.FindControl("PM_Promotor_Sex") : null; if (Tools.DoVerifyIDCode(((TextBox)sender).Text, out BirthDay, out Sex) && ((TextBox)sender).Text.Trim().Length == 18) { if (txt_birthday != null) { txt_birthday.Text = BirthDay.ToString("yyyy-MM-dd"); } if (ddl_sex != null) { ddl_sex.SelectedValue = Sex.ToString(); } if (DateTime.Now < BirthDay.AddYears(16) || DateTime.Now > BirthDay.AddYears(50)) { int year = DateTime.Now.Year - BirthDay.Year; if (BirthDay.AddYears(year) > DateTime.Now) { year++; } MessageBox.Show(this, "对不起,该导购年龄不符合规则(16~49岁),该人员年龄:" + year); return; } } else { MessageBox.Show(this, "身份证号码错误!"); ((TextBox)sender).Text = ""; if (txt_birthday != null) { txt_birthday.Text = ""; } if (ddl_sex != null) { ddl_sex.SelectedValue = "0"; } return; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { #region 获取页面参数 ViewState["InventoryID"] = Request.QueryString["InventoryID"] == null ? 0 : int.Parse(Request.QueryString["InventoryID"]); ViewState["ClientID"] = Request.QueryString["ClientID"] == null ? 0 : int.Parse(Request.QueryString["ClientID"]); ViewState["IsCXP"] = Request.QueryString["IsCXP"] == null ? false : int.Parse(Request.QueryString["IsCXP"]) != 0; //是否是赠品销量录入 0:成品 1:赠品 #endregion ViewState["EditEnable"] = true; if ((int)ViewState["InventoryID"] != 0) { if (Request.QueryString["Flag"] == null) { cb_OnlyDisplayUnZero.Checked = true; } BindData(); btn_Inventory.Visible = false; TextBox tbx_InventoryDate = UC_DetailView1.FindControl("SVM_Inventory_InventoryDate") != null ? (TextBox)UC_DetailView1.FindControl("SVM_Inventory_InventoryDate") : null; } else { if ((int)ViewState["ClientID"] == 0) { Response.Redirect("InventoryList.aspx"); } #region 新增库存 CM_Client c = new CM_ClientBLL((int)ViewState["ClientID"]).Model; MCSSelectControl select_Client = (MCSSelectControl)UC_DetailView1.FindControl("SVM_Inventory_Client"); if (select_Client != null) { select_Client.SelectValue = ViewState["ClientID"].ToString(); select_Client.SelectText = c.FullName; select_Client.Enabled = false; } MCSTreeControl tr_OrganizeCity = (MCSTreeControl)UC_DetailView1.FindControl("SVM_Inventory_OrganizeCity"); if (tr_OrganizeCity != null) { tr_OrganizeCity.SelectValue = c.OrganizeCity.ToString(); tr_OrganizeCity.Enabled = false; } DropDownList ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_Inventory_AccountMonth"); if (ddl_Month != null) { double JXCDelayDays = Convert.ToDouble(System.Configuration.ConfigurationManager.AppSettings["JXCDelayDays"]); ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-JXCDelayDays)).ToString(); } #region 判断是否有未审核销售 //if (c.ClientType == 2 && SVM_SalesVolumeBLL.GetModelList("Supplier=" + c.ID.ToString() + " AND ApproveFlag=2 AND AccountMonth=" + ddl_Month.SelectedValue).Count > 0) //{ // MessageBox.ShowAndRedirect(this, "该经销商本月还有未审核销量,请先审核销量再作此操作。", "SalesVolumeList.aspx?Type=2&SellOutClientID=" + c.ID.ToString()); // return; //} #endregion TextBox tbx_InventoryDate = (TextBox)UC_DetailView1.FindControl("SVM_Inventory_InventoryDate"); if (tbx_InventoryDate != null) { tbx_InventoryDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); } bt_Del.Visible = false; bt_Save.Visible = false; bt_Approve.Visible = false; bt_Submit.Visible = false; bt_Approve.Visible = false; bt_Re_Approve.Visible = false; tb_AddProduct.Visible = false; #endregion } BindDropDown(); #region 确定页面权限 if ((int)ViewState["ClientID"] != 0) { CM_Client _r = new CM_ClientBLL((int)ViewState["ClientID"]).Model; ViewState["ClientType"] = _r.ClientType; if (_r.ClientType == 3) { Header.Attributes["WebPageSubCode"] += "ClientType=3"; bt_Submit.Enabled = false; ViewState["EditEnable"] = false; lbl_Notice.Text = "请以最小单位数量填报"; } else if (_r.ClientType == 2) { Header.Attributes["WebPageSubCode"] += "ClientType=2&DIClassify=" + _r["DIClassify"]; } } #endregion } }
protected void Page_Load(object sender, System.EventArgs e) { #region 获取界面控件 tr_OfficialCity = UC_DetailView1.FindControl("PM_Promotor_OfficialCity") == null ? null : (MCSTreeControl)UC_DetailView1.FindControl("PM_Promotor_OfficialCity"); tr_OrganizeCity = UC_DetailView1.FindControl("PM_Promotor_OrganizeCity") == null ? null : (MCSTreeControl)UC_DetailView1.FindControl("PM_Promotor_OrganizeCity"); txt_IDCode = UC_DetailView1.FindControl("PM_Promotor_IDCode") == null ? null : (TextBox)UC_DetailView1.FindControl("PM_Promotor_IDCode"); txt_Name = UC_DetailView1.FindControl("PM_Promotor_Name") == null ? null : (TextBox)UC_DetailView1.FindControl("PM_Promotor_Name"); txt_AccountName = UC_DetailView1.FindControl("PM_Promotor_AccountName") == null ? null : (TextBox)UC_DetailView1.FindControl("PM_Promotor_AccountName"); ddl_BankType = UC_DetailView1.FindControl("PM_Promotor_BankType") == null ? null : (DropDownList)UC_DetailView1.FindControl("PM_Promotor_BankType"); txt_BankName = UC_DetailView1.FindControl("PM_Promotor_BankName") == null ? null : (TextBox)UC_DetailView1.FindControl("PM_Promotor_BankName"); ddl_Classify = UC_DetailView1.FindControl("PM_Promotor_Classfiy") == null ? null : (DropDownList)UC_DetailView1.FindControl("PM_Promotor_Classfiy"); if (ddl_BankType != null) { ddl_BankType.AutoPostBack = true; ddl_BankType.SelectedIndexChanged += new EventHandler(ddl_BankType_SelectedIndexChanged); } if (ddl_Classify != null) { ddl_Classify.AutoPostBack = true; ddl_Classify.SelectedIndexChanged += new EventHandler(ddl_Classify_SelectedIndexChanged); } if (tr_OrganizeCity != null) { tr_OrganizeCity.AutoPostBack = true; tr_OrganizeCity.Selected += new SelectedEventHandler(tr_OrganizeCity_Selected); } if (txt_IDCode != null) { txt_IDCode.AutoPostBack = true; txt_IDCode.TextChanged += new EventHandler(txt_IDCode_TextChanged); } if (txt_Name != null) { txt_Name.AutoPostBack = true; txt_Name.TextChanged += new EventHandler(txt_Name_TextChanged); } #endregion if (!Page.IsPostBack) { ViewState["PromotorID"] = Request.QueryString["PromotorID"] == null ? 0 : int.Parse(Request.QueryString["PromotorID"]); if ((int)ViewState["PromotorID"] > 0) { BindDropDown(); BindData(); UploadFile1.RelateID = (int)ViewState["PromotorID"]; UploadFile1.BindGrid(); } else { Org_Staff s = new Org_StaffBLL((int)Session["UserID"]).Model; if (s != null) { if (tr_OfficialCity != null) { tr_OfficialCity.SelectValue = s.OfficialCity.ToString(); } if (tr_OrganizeCity != null) { tr_OrganizeCity.SelectValue = s.OrganizeCity.ToString(); } } DropDownList ddl_SalaryFlag = (DropDownList)UC_DetailView1.FindControl("PM_Promotor_SalaryFlag"); if (ddl_SalaryFlag != null) { ddl_SalaryFlag.SelectedValue = "1"; } DropDownList ddl_Dimission = (DropDownList)UC_DetailView1.FindControl("PM_Promotor_Dimission"); if (ddl_Dimission != null) { ddl_Dimission.Enabled = false; ddl_Dimission.SelectedValue = "1"; } TextBox tbx_EndWorkDate = (TextBox)UC_DetailView1.FindControl("PM_Promotor_EndWorkDate"); if (tbx_EndWorkDate != null) { tbx_EndWorkDate.Enabled = false; } tbl_Promotor.Visible = false; UploadFile1.Visible = false; gv_list.Visible = false; bt_AddApply.Visible = false; bt_Approve.Visible = false; bt_RevocationApply.Visible = false; } //根据管理片区,获取可用的薪酬级别 tr_OrganizeCity_Selected(null, null); } #region 给账号/开户行文本框添加事件 //TextBox tbx_BankName = (TextBox)UC_DetailView1.FindControl("PM_Promotor_BankName"); //tbx_BankName.AutoPostBack = true; //tbx_BankName.TextChanged += new EventHandler(tbx_Bank_TextChanged); TextBox tbx_BankAccountNo = (TextBox)UC_DetailView1.FindControl("PM_Promotor_AccountCode"); tbx_BankAccountNo.AutoPostBack = true; tbx_BankAccountNo.TextChanged += new EventHandler(tbx_Bank_TextChanged); #endregion if ((int)ViewState["PromotorID"] == 0) { MCSTabControl1.Items[1].Visible = false; } string script = "function PopPMClassify_Approve(id){\r\n"; script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("~/SubModule/PM/PMClassify_Approve.aspx?PromotorID=' + id ") + ", window, 'dialogWidth:930px;DialogHeight=600px;status:yes;resizable=yes');}"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopPMClassify_Approve", script, true); }
protected void bt_OK_Click(object sender, EventArgs e) { PM_PromotorBLL _promotor = null; if ((int)ViewState["PromotorID"] == 0) { _promotor = new PM_PromotorBLL(); } else { _promotor = new PM_PromotorBLL((int)ViewState["PromotorID"]); } int classify = 0, oldClassify = 0; int.TryParse(_promotor.Model["Classfiy"], out oldClassify); int oldOrganizeCity = _promotor.Model.OrganizeCity; UC_DetailView1.GetData(_promotor.Model); #region 判断数据有效性 if (!(_promotor.Model.OrganizeCity > 1)) { MessageBox.Show(this, "请选择导购员所在的管理片区!"); return; } int.TryParse(_promotor.Model["Classfiy"], out classify); if (classify == 0) { MessageBox.Show(this, "请正确选择导购员类别!"); return; } if (_promotor.Model["InfoSource"] == "" || _promotor.Model["InfoSource"] == "0") { MessageBox.Show(this, "请正确选择导购来源!"); return; } if (_promotor.Model["OldClassify"] == "" || _promotor.Model["OldClassify"] == "0") { MessageBox.Show(this, "请正确选择原属品牌!"); return; } if (_promotor.Model["BankType"] == "" || _promotor.Model["BankType"] == "0") { MessageBox.Show(this, "请正确选择银行信息"); return; } int bankid = int.Parse(ddl_BankType.SelectedValue); if (_promotor.Model["BankName"] == "" || bankid <= 2 && _promotor.Model["BankName"] != ddl_BankType.SelectedItem.Text) { MessageBox.Show(this, "银行备注信息不正确"); return; } //Org_Staff _staffM = new Org_StaffBLL((int)Session["UserID"]).Model; //if (_staffM.OrganizeCity == _promotor.Model.OrganizeCity) //{ // MessageBox.Show(this, "对不起,你不能把导购员放在与你同级的管理片区"); // return; //} #endregion #region 判断在职及离职状态 if (_promotor.Model.Dimission == 1) { _promotor.Model.EndWorkDate = new DateTime(1900, 1, 1); } else if (_promotor.Model.EndWorkDate == new DateTime(1900, 1, 1)) { _promotor.Model.EndWorkDate = DateTime.Today; } #endregion #region 如果有工资生成判断离职时间 if ((int)ViewState["PromotorID"] > 0) { string[] allowday = Addr_OrganizeCityParamBLL.GetValueByType(1, 3).Split(new char[] { ',', ',', ';', ';' }); AC_AccountMonth lastmonth = GetMaxSalaryDate((int)ViewState["PromotorID"], AC_AccountMonthBLL.GetCurrentMonth() - 1); if (lastmonth != null && allowday.Contains(DateTime.Now.Day.ToString()) && _promotor.Model.BeginWorkDate > lastmonth.EndDate) { MessageBox.Show(this, "该导购在" + lastmonth.Name + "生成过工资,入职日期不能大于" + lastmonth.EndDate.ToString("yyyy-MM-dd")); return; } if (_promotor.Model.Dimission == 2 && _promotor.Model.EndWorkDate < _promotor.Model.BeginWorkDate && _promotor.Model.EndWorkDate.AddDays(40) > DateTime.Now) { MessageBox.Show(this, "导购离职日期不能小于入职日期!"); return; } AC_AccountMonth month = GetMaxSalaryDate((int)ViewState["PromotorID"], 0); if (month != null && _promotor.Model.Dimission == 2 && _promotor.Model.EndWorkDate < month.BeginDate) { MessageBox.Show(this, "该导购在" + month.Name + "生成过工资,离职日期不能小于" + month.BeginDate.ToString("yyyy-MM-dd")); return; } } #endregion if (_promotor.Model["IDCode"] != string.Empty && _promotor._GetModelList("ID!=" + ViewState["PromotorID"].ToString() + " AND MCS_SYS.dbo.UF_Spilt(PM_Promotor.ExtPropertys,'|',1)='" + _promotor.Model["IDCode"] + "'").Count > 0) { MessageBox.Show(this, "对不起,该身份证号的导购员已在系统中,请核实后再新增!"); return; } if ((int)ViewState["PromotorID"] == 0) { DateTime birthday; if (DateTime.TryParse(_promotor.Model["Birthday"], out birthday)) { if (DateTime.Now < birthday.AddYears(16) || DateTime.Now > birthday.AddYears(50)) { int year = DateTime.Now.Year - birthday.Year; if (birthday.AddYears(year) > DateTime.Now) { year++; } MessageBox.Show(this, "对不起,该导购年龄不符合规则(16~49岁),该人员年龄:" + year); return; } } if (PM_PromotorNumberLimitBLL.CheckAllowAdd(_promotor.Model.OrganizeCity, classify) <= 0) { MessageBox.Show(this, "对不起当前城市导购员人数满额,要想继续新增请与人事经理联系"); return; } _promotor.Model.InputStaff = (int)Session["UserID"]; _promotor.Model.ApproveFlag = 2; _promotor.Model.Dimission = 1; _promotor.Model.EndWorkDate = new DateTime(1900, 1, 1); ViewState["PromotorID"] = _promotor.Add(); } else { if (!PM_PromotorNumberLimitBLL.IsSameLimit(oldOrganizeCity, _promotor.Model.OrganizeCity, oldClassify, classify) && PM_PromotorNumberLimitBLL.CheckAllowAdd(_promotor.Model.OrganizeCity, classify) <= 0) { MessageBox.Show(this, "对不起当前城市导购员人数满额,要想继续新增请与人事经理联系"); return; } _promotor.Model.UpdateStaff = (int)Session["UserID"]; _promotor.Update(); } if (sender != null) { Response.Redirect("PM_PromotorDetail.aspx?PromotorID=" + ViewState["PromotorID"].ToString()); } }
private void BindData() { PM_Promotor m = new PM_PromotorBLL((int)ViewState["PromotorID"]).Model; UC_DetailView1.BindData(m); gv_list.ConditionString = " Promotor= " + (int)ViewState["PromotorID"]; gv_list.BindGrid(); //验证身份证号码 txt_BankName.Enabled = m["BankType"] == "3"; if (m.ApproveFlag == 1) { bt_Approve.Visible = false; if (m.Dimission == 1) { TextBox txt_EndWorkDate = (TextBox)UC_DetailView1.FindControl("PM_Promotor_EndWorkDate"); if (txt_EndWorkDate != null) { txt_EndWorkDate.Enabled = false; } bt_AddApply.Visible = false; #region 导购兼职/专职转换 int classfiy = 0; int.TryParse(m["Classfiy"], out classfiy); if (classfiy == 0) { bt_ChangeClassify.Visible = false; } else if (classfiy == 1 || classfiy == 2) { bt_ChangeClassify.Text = "转为兼职"; bt_ChangeClassify.Visible = true; } else { bt_ChangeClassify.Text = "转为专职/流动"; bt_ChangeClassify.Visible = true; } bt_ChangeClassify.OnClientClick = "PopPMClassify_Approve(" + ViewState["PromotorID"].ToString() + ")"; #endregion } Header.Attributes["WebPageSubCode"] = "Modify"; //TextBox txt_BeginWorkDate = (TextBox)UC_DetailView1.FindControl("PM_Promotor_BeginWorkDate"); //临时开放修改功能 //if (txt_BeginWorkDate != null && m.Dimission==1) txt_BeginWorkDate.Enabled = false; //有些离职日期会填写错误,更新为权限修改 12.11.21 //if (m.Dimission == 2) //{ // TextBox txt_EndWorkDate = (TextBox)UC_DetailView1.FindControl("PM_Promotor_EndWorkDate"); // if (txt_EndWorkDate != null) txt_EndWorkDate.Enabled = false; //} string[] allowdays = Addr_OrganizeCityParamBLL.GetValueByType(1, 9).Replace(" ", "").Split(new char[] { ',', ',', ';', ';' }); if (allowdays.Contains(DateTime.Now.Day.ToString())) { bt_ChangeClassify.Enabled = false; bt_ChangeClassify.ToolTip = "导购工资生成期间不能互转"; } } if (m["State"] == "2") { //审批中 bt_AddApply.Visible = false; bt_OK.Visible = false; bt_TaskDetail.Visible = true; bt_ChangeClassify.Enabled = false; bt_ChangeClassify.ToolTip = "该导购有未完成的流程,请待流程完成后,再做调整!"; } bt_OK.Text = "保 存"; bt_OK.ForeColor = System.Drawing.Color.Red; if (m["Classfiy"] != "") { int budget = PM_PromotorNumberLimitBLL.CheckOverBudget(m.OrganizeCity, int.Parse(m["Classfiy"])); if (budget == 0) { lb_OverBudgetInfo.Text = "导购员数量已等于预定的预算人数,请注意!"; } else if (budget < 0) { lb_OverBudgetInfo.Text = "导购员数量已超过预定的预算人数 " + (0 - budget).ToString() + "人,请注意!"; } } if (m["IDCode"].Length == 18 && !Tools.DoVerifyIDCode(m["IDCode"])) { lb_OverBudgetInfo.Text += " 注意:该导购员身份证号码错误!"; } ddl_Classify_SelectedIndexChanged(null, null); }
protected void cbx_UpdateAccountMonth_CheckedChanged(object sender, EventArgs e) { DropDownList ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_SalesForcast_AccountMonth"); ddl_Month.Enabled = cbx_UpdateAccountMonth.Checked; }
protected void Page_Load(object sender, EventArgs e) { #region 获取界面控件 ddl_BasePayMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_BasePayMode"); ddl_BasePaySubsidyMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_BasePaySubsidyMode"); ddl_MinimumWageMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_MinimumWageMode"); ddl_InsuranceMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_InsuranceMode"); ddl_SeniorityPayMode = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_SeniorityPayMode"); ddl_SalesType = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_SalesType"); ddl_BasePayMode.AutoPostBack = true; ddl_BasePayMode.SelectedIndexChanged += new EventHandler(ddl_BasePayMode_SelectedIndexChanged); ddl_BasePaySubsidyMode.AutoPostBack = true; ddl_BasePaySubsidyMode.SelectedIndexChanged += new EventHandler(ddl_BasePaySubsidyMode_SelectedIndexChanged); ddl_MinimumWageMode.AutoPostBack = true; ddl_MinimumWageMode.SelectedIndexChanged += new EventHandler(ddl_MinimumWageMode_SelectedIndexChanged); ddl_InsuranceMode.AutoPostBack = true; ddl_InsuranceMode.SelectedIndexChanged += new EventHandler(ddl_InsuranceMode_SelectedIndexChanged); txt_AvgSales = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_AvgSales"); txt_BaseFeeRate = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_BaseFeeRate"); txt_FloatingTarget = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_FloatingTarget"); chk_arrivetarget.Text = "是否达到过上限"; chk_arrivetarget.Enabled = false; txt_FloatingTarget.Parent.Controls.Add(chk_arrivetarget); #endregion if (!IsPostBack) { ViewState["PromotorSalaryID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]); ViewState["PromotorID"] = Request.QueryString["PromotorID"] == null ? 0 : int.Parse(Request.QueryString["PromotorID"]); ViewState["AvgSales"] = 0m; ViewState["BaseFeeRate"] = 0m; if ((int)ViewState["PromotorSalaryID"] > 0) { PM_PromotorSalary m = new PM_PromotorSalaryBLL((int)ViewState["PromotorSalaryID"]).Model; if (m != null) { BindData(m); bt_Add.Visible = false; } else { Response.Redirect("PM_PromotorDetail.aspx"); } } else if ((int)ViewState["PromotorID"] > 0) { IList <PM_PromotorSalary> lists = PM_PromotorSalaryBLL.GetModelList("Promotor=" + ViewState["PromotorID"].ToString() + " AND State <= 3 ORDER BY State DESC,ID DESC"); if (lists.Count == 0) { //新增薪资标准 #region 判断当前导购是否有所在工作的门店 if (PM_PromotorInRetailerBLL.GetModelList("Promotor=" + ViewState["PromotorID"].ToString()).Count == 0) { MessageBox.ShowAndRedirect(this, "请设置该导购员所在的门店!", "PM_PromotorDetail.aspx?PromotorID=" + ViewState["PromotorID"].ToString()); return; } #endregion BindData(null); bt_Add.Visible = false; } else { BindData(lists[0]); if (lists.FirstOrDefault(p => p.State < 3) != null) { bt_Add.Visible = false; } } } else { Response.Redirect("PM_PromotorDetail.aspx"); } } }
protected void bt_Approve_Click(object sender, EventArgs e) { FNA_ClientPaymentInfoBLL bll; if ((int)ViewState["ID"] > 0) { bt_Save_Click(null, null); TextBox tbx_ConfirmDate = UC_DetailView1.FindControl("FNA_ClientpaymentInfo_ConfirmDate") == null ?null: (TextBox)UC_DetailView1.FindControl("FNA_ClientpaymentInfo_ConfirmDate"); DateTime confirmdate = DateTime.Now; if (tbx_ConfirmDate != null && !DateTime.TryParse(tbx_ConfirmDate.Text, out confirmdate)) { MessageBox.Show(this, "确认到账日期必需按正确日期格式yyyy-mm-dd填写!"); return; } bll = new FNA_ClientPaymentInfoBLL((int)ViewState["ID"]); bll.Confirm((int)Session["UserID"], confirmdate); Response.Redirect("ClientPaymentList.aspx?ClientID=" + bll.Model.Client.ToString()); } }
private void BindData(PM_PromotorSalary m) { if (m != null) { ViewState["PromotorID"] = m.Promotor; ViewState["PromotorSalaryID"] = m.ID; } #region 获取当前导购标准薪资、保底薪资、导购管理费 if ((int)ViewState["PromotorID"] > 0) { decimal basepay = 0, minumumwage = 0, rtmanagecost = 0; new PM_PromotorBLL((int)ViewState["PromotorID"]).GetStdPay(out basepay, out minumumwage, out rtmanagecost); ViewState["BasePay"] = basepay; ViewState["MinumumWage"] = minumumwage; ViewState["RTManageCost"] = rtmanagecost; } #endregion PM_Promotor p = new PM_PromotorBLL((int)ViewState["PromotorID"]).Model; if (p == null) { Response.Redirect("PM_PromotorDetail.aspx"); } if (m == null) { m = new PM_PromotorSalary(); m.Promotor = (int)ViewState["PromotorID"]; m.State = 1; m.InsertStaff = (int)Session["UserID"]; m.RTManageCost = (decimal)ViewState["RTManageCost"]; if (p["Classfiy"] == "1" || p["Classfiy"] == "2") { m.SeniorityPayMode = 1; } } if (p["State"] == "2") { bt_Add.Visible = false; } UC_DetailView1.BindData(m); chk_arrivetarget.Checked = m["ISArriveTarget"] == "1"; UC_DetailView1.SetControlsEnable(m.State == 1); bt_OK.Enabled = m.State == 1; if (m.ID != 0) { bt_Delete.Enabled = m.State == 1; bt_Submit.Enabled = m.State == 1; bt_Approve.Enabled = m.State == 1; } else { bt_Submit.Enabled = false; bt_Approve.Enabled = false; bt_Delete.Enabled = false; } if (m.BasePayMode != 4 && m.BasePayMode != 5) { setdisabledfloatingcontorl(false); } //导购为新入职、或离职状态 if (p.ApproveFlag == 2) { bt_Submit.Visible = false; } //if (p.Dimission == 2) bt_Add.Visible = false; if (m.RTManageCost > 0 && (decimal)ViewState["RTManageCost"] == m.RTManageCost) { TextBox tbx = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_RTManageCost"); if (tbx != null) { tbx.Enabled = false; } } if (m.State < 2) { #region 兼职导购的限定 try { if (ddl_BasePayMode != null) { if (p["Classfiy"] != "1" && p["Classfiy"] != "2") //非专职、非流导,认为是兼职导购 { //兼职 //ddl_BasePayMode.Items[0].Enabled = false; //ddl_BasePayMode.Items[1].Enabled = false; //ddl_BasePayMode.Items[2].Enabled = false; SetControlsEnable(false); ddl_BasePayMode.SelectedValue = "3"; ddl_BasePayMode.Enabled = false; } else { Addr_OrganizeCityBLL _bll = new Addr_OrganizeCityBLL(p.OrganizeCity); string[] city3s = Addr_OrganizeCityParamBLL.GetValueByType(1, 19).Split(new char[] { ',', ',', ';', ';' }); int city3ID = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OrganizeCity", p.OrganizeCity, ConfigHelper.GetConfigInt("OrganizePartCity-CityLevel")); if (city3s.Contains(city3ID.ToString())) { ddl_BasePayMode.Items.Remove(new ListItem("浮动底薪(非华南)", "4")); } else { decimal AvgSales = 0, BaseFeeRate = 0; int SalaryDelayDays = ConfigHelper.GetConfigInt("SalaryDelayDays"); ddl_SalesType.Enabled = false; new PM_PromotorSalaryBLL().GetFloatingInfo(p.ID, AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-SalaryDelayDays)) - 1, out AvgSales, out BaseFeeRate); if (AvgSales == 0 && BaseFeeRate == 0)//首两月不是固定底薪,不能选择浮动底薪 { ddl_BasePayMode.Items.Remove(new ListItem("浮动底薪(非华南)", "4")); } else { ViewState["AvgSales"] = AvgSales; ViewState["BaseFeeRate"] = BaseFeeRate; } ddl_BasePayMode.Items.Remove(new ListItem("浮动底薪(华南)", "5")); } ddl_BasePayMode.Items.Remove(new ListItem("兼职底薪", "3")); //50岁只能选择商保(5)或自购(8) DateTime Birthday; if (DateTime.TryParse(p["Birthday"], out Birthday) && Birthday.AddYears(50) < DateTime.Now) { foreach (ListItem item in ddl_InsuranceMode.Items) { if (item.Value != "5" && item.Value != "8" && item.Value != "0") { item.Enabled = false; } } } //专职或流导 //ddl_BasePayMode.Items[3].Enabled = false; } } } catch { } #endregion ddl_BasePayMode_SelectedIndexChanged(null, null); ddl_BasePaySubsidyMode_SelectedIndexChanged(null, null); ddl_InsuranceMode_SelectedIndexChanged(null, null); ddl_MinimumWageMode_SelectedIndexChanged(null, null); } BindGrid(); }
private void ddl_PayType_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl_PayType = (DropDownList)sender; DropDownList ddl_AmountType = UC_DetailView1.FindControl("FNA_ClientPaymentInfo_AmountType") == null ? null : (DropDownList)UC_DetailView1.FindControl("FNA_ClientPaymentInfo_AmountType"); IList <Dictionary_Data> amounttypelist = DictionaryBLL.Dictionary_Data_GetAlllList("Type=720 AND Description='" + ddl_PayType.SelectedValue + "'"); ddl_AmountType.Items.Clear(); foreach (Dictionary_Data amount in amounttypelist) { ddl_AmountType.Items.Add(new ListItem(amount.Name, amount.Code)); } ddl_AmountType.Items.Insert(0, new ListItem("所有", "0")); ddl_AmountType.SelectedValue = (int)ViewState["ID"] != 0? new FNA_ClientPaymentInfoBLL((int)ViewState["ID"]).Model["AmountType"]:"0"; }
protected void bt_OK_Click(object sender, EventArgs e) { PM_PromotorSalaryBLL bll; if ((int)ViewState["PromotorSalaryID"] == 0) { bll = new PM_PromotorSalaryBLL(); } else { bll = new PM_PromotorSalaryBLL((int)ViewState["PromotorSalaryID"]); } UC_DetailView1.GetData(bll.Model); #region 数据录入判断 if (bll.Model.BasePayMode == 0) { MessageBox.Show(this, "请选择正确的底薪模式!"); return; } if (bll.Model.BasePayMode == 1) { if (bll.Model.SeniorityPayMode == 0) { MessageBox.Show(this, "当底薪模式为固定底薪时,必须选择工龄工资模式!"); return; } if (bll.Model.InsuranceMode == 0) { MessageBox.Show(this, "当底薪模式为固定底薪时,必须选择社保!"); return; } } if (bll.Model.BasePaySubsidyMode != 0 && bll.Model.BasePaySubsidy == 0) { MessageBox.Show(this, "当选择了底薪补贴类型时,请设定补贴金额!"); return; } if (bll.Model.BasePaySubsidyMode != 0 && bll.Model.BasePaySubsidyBeginDate.Year == 1900) { MessageBox.Show(this, "当选择了底薪补贴类型时,请设定底薪补贴起始日期!"); return; } if (bll.Model.BasePaySubsidyMode == 1 && bll.Model.BasePaySubsidyEndDate.Year == 1900) { MessageBox.Show(this, "当选择了底薪补贴类型为临时补贴时,请设定底薪补贴截止日期!"); return; } decimal BasePaySubsidylimt = 0; decimal.TryParse(Addr_OrganizeCityParamBLL.GetValueByType(1, 22), out BasePaySubsidylimt); if (BasePaySubsidylimt > 0 && BasePaySubsidylimt < bll.Model.BasePaySubsidy) { MessageBox.Show(this, "底薪补贴不得超过上限" + BasePaySubsidylimt.ToString() + "元"); return; } if (bll.Model.MinimumWageMode == 2 && bll.Model.MinimumWage == 0) { MessageBox.Show(this, "当选择了特殊保底时,请设定保底金额!"); return; } decimal MinimumWagelimit = 0; decimal.TryParse(Addr_OrganizeCityParamBLL.GetValueByType(1, 23), out MinimumWagelimit); if (bll.Model.MinimumWageMode == 2 && MinimumWagelimit > 0 && MinimumWagelimit < bll.Model.MinimumWage) { MessageBox.Show(this, "当选择了特殊保底时,保底工资不能超过上限" + MinimumWagelimit.ToString() + "元!"); return; } if (bll.Model.MinimumWageMode != 0 && bll.Model.MinimumWageBeginDate.Year == 1900) { MessageBox.Show(this, "当选择了薪资保底时,请设定保底的起始日期!"); return; } if (bll.Model.MinimumWageMode != 0 && bll.Model.MinimumWageEndDate.Year == 1900) { MessageBox.Show(this, "当选择了薪资保底时,请设定保底的截止日期!"); return; } if (bll.Model.InsuranceMode == 0 && bll.Model.BasePayMode != 3) { MessageBox.Show(this, "非兼职,请选择正确的社保模式!"); return; } if (bll.Model.InsuranceMode == 1 && bll.Model.InsuranceSubsidy <= 0) { MessageBox.Show(this, "请正确输入保险补贴金额!"); return; } if (bll.Model.BasePayMode == 4 && bll.Model["FloatingTarget"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(非华南)时,请设定浮动底薪上限任务量!"); return; } if (bll.Model.BasePayMode == 4 && bll.Model["AvgSales"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(非华南)时,请设定前两月平均销量!"); return; } //if (bll.Model.BasePayMode == 4 && bll.Model["BaseFeeRate"] == "0") //{ // MessageBox.Show(this, "当底薪模式为浮动底薪(非华南)时,请设定底薪费率!"); // return; //} if (bll.Model.BasePayMode == 5 && bll.Model["SalesType"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(华南)时,请设定实销类别!"); return; } if (bll.Model.BasePayMode == 5 && bll.Model["BaseFeeRate"] == "0") { MessageBox.Show(this, "当底薪模式为浮动底薪(华南)时,请设定底薪费率!"); return; } #endregion bll.Model["ISArriveTarget"] = chk_arrivetarget.Checked ? "1" : "2"; if ((int)ViewState["PromotorSalaryID"] == 0) { bll.Model.Promotor = (int)ViewState["PromotorID"]; bll.Model.State = 1; bll.Model.ApproveFlag = 2; bll.Model.InsertStaff = (int)Session["UserID"]; ViewState["PromotorSalaryID"] = bll.Add(); } else { bll.Update(); } BindGrid(); MessageBox.ShowAndRedirect(this, "保存成功!", "PM_PromotorSalaryDetail.aspx?ID=" + ViewState["PromotorSalaryID"].ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { #region 获取页面参数 ViewState["TargetID"] = Request.QueryString["TargetID"] == null ? 0 : int.Parse(Request.QueryString["TargetID"]); ViewState["ClientID"] = Request.QueryString["ClientID"] == null ? 0 : int.Parse(Request.QueryString["ClientID"]); #endregion BindDropDown(); if ((int)ViewState["TargetID"] != 0) { BindData(); btn_SalesTarget.Visible = false; } else { if ((int)ViewState["ClientID"] == 0) { Response.Redirect("SalesTarget.aspx"); } #region 新增销量目标 CM_Client c = new CM_ClientBLL((int)ViewState["ClientID"]).Model; MCSSelectControl select_Client = (MCSSelectControl)UC_DetailView1.FindControl("SVM_SalesTarget_Client"); if (select_Client != null) { select_Client.SelectValue = ViewState["ClientID"].ToString(); select_Client.SelectText = c.FullName; select_Client.Enabled = false; } MCSTreeControl tr_OrganizeCity = (MCSTreeControl)UC_DetailView1.FindControl("SVM_SalesTarget_OrganizeCity"); if (tr_OrganizeCity != null) { tr_OrganizeCity.SelectValue = c.OrganizeCity.ToString(); tr_OrganizeCity.Enabled = false; } DropDownList ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_SalesTarget_AccountMonth"); if (ddl_Month != null) { ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-7).AddMonths(1)).ToString(); } bt_Del.Visible = false; bt_Save.Visible = false; bt_Approve.Visible = false; #endregion } #region 确定页面权限 if ((int)ViewState["ClientID"] != 0) { CM_Client _r = new CM_ClientBLL((int)ViewState["ClientID"]).Model; ViewState["ClientType"] = _r.ClientType; if (_r.ClientType == 3) { Header.Attributes["WebPageSubCode"] += "ClientType=3"; } else if (_r.ClientType == 2) { Header.Attributes["WebPageSubCode"] += "ClientType=2&DIClassify=" + _r["DIClassify"]; } } #endregion } }
private void BindData() { UC_DetailView1.BindData(new UD_TableListBLL((Guid)ViewState["TableID"]).Model); }