private void BindGrid()
    {
        string condition = "SVM_InventoryDifferences_Detail.InventoryID=" + ViewState["InventoryID"].ToString();

        if (ddl_Classify.SelectedValue.CompareTo("0") > 0)
        {
            condition += " AND PDT_Product.Classify=" + ddl_Classify.SelectedValue;
        }
        else if (ddl_Brand.SelectedValue.CompareTo("0") > 0)
        {
            condition += "AND PDT_Product.Brand=" + ddl_Brand.SelectedValue;
        }

        if (select_Product1.SelectValue != "")
        {
            condition += " AND SVM_InventoryDifferences_Detail.Product=" + select_Product1.SelectValue;
        }

        if (cb_OnlyDisplayUnZero.Checked)
        {
            condition += " AND SVM_InventoryDifferences_Detail.Quantity <> 0";
        }
        DropDownList       ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_InventoryDifferences_AccountMonth");
        AC_AccountMonthBLL prbll     = new AC_AccountMonthBLL(int.Parse(ddl_Month.SelectedValue) - 1);

        //gv_List.Columns[4].HeaderText = ddl_Month.SelectedItem.Text.Substring( ddl_Month.SelectedItem.Text.LastIndexOf("-")+1)+ "月实时库存(实物)";
        //gv_List.Columns[5].HeaderText = prbll.Model.Month + "月" + "20日期末实物库存";
        gv_List.ConditionString = condition;
        gv_List.BindGrid();

        if (!bt_Save.Visible)
        {
            gv_List.SetControlsEnable(false);
        }
    }
    void tbx_Bank_TextChanged(object sender, EventArgs e)
    {
        int     bankid            = int.Parse(ddl_BankType.SelectedValue);
        TextBox tbx_BankAccountNo = (TextBox)UC_DetailView1.FindControl("PM_Promotor_AccountCode");

        if (bankid == 0)
        {
            return;
        }
        else
        {
            if (bankid == 2 && !tbx_BankAccountNo.Text.Trim().StartsWith("6228") && !tbx_BankAccountNo.Text.Trim().StartsWith("9559"))
            {
                MessageBox.Show(this, "所填账号非农行卡号,请检查!");
                tbx_BankAccountNo.Text = "";
            }
            else if (bankid == 1 && (tbx_BankAccountNo.Text.Trim().StartsWith("6228") || tbx_BankAccountNo.Text.Trim().StartsWith("9559")))
            {
                MessageBox.Show(this, "所填账号非建行卡号,请检查!");
                tbx_BankAccountNo.Text = "";
            }
            else if (bankid == 3 && (txt_BankName.Text.Contains("农业银行") || txt_BankName.Text.Contains("建设银行") || txt_BankName.Text.Contains("农行") || txt_BankName.Text.Contains("建行")))
            {
                MessageBox.Show(this, "如果是建行或农行,请直接选择对应银行!");
                txt_BankName.Text = ""; ddl_BankType.SelectedIndex = 0;
            }
        }
    }
Exemplo n.º 3
0
    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);
        }
    }
 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();
         }
     }
 }
Exemplo n.º 5
0
    void bt_Compute_Click(object sender, EventArgs e)
    {
        decimal score = ComputeTotalScore();
        Label   lb    = (Label)UC_DetailView1.FindControl("CM_KPI_TotalScore");

        lb.Text = score.ToString();
    }
    private void Save()
    {
        SVM_ClassifyForcastBLL bll       = new SVM_ClassifyForcastBLL((int)ViewState["ForcastID"]);
        DropDownList           ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_ClassifyForcast_AccountMonth");

        bll.Model.AccountMonth = int.Parse(ddl_Month.SelectedValue);
        bll.Update();
        foreach (GridViewRow gr in gv_List.Rows)
        {
            int id = (int)gv_List.DataKeys[gr.RowIndex][0];
            SVM_ClassifyForcast_Detail item = bll.GetDetailModel(id);

            TextBox tbx_Amount = (TextBox)gr.FindControl("tbx_Amount");
            if (tbx_Amount != null && tbx_Amount.Enabled)
            {
                item.Amount = decimal.Parse(tbx_Amount.Text);
            }
            else
            {
                Label   lbl_Sales = (Label)gr.FindControl("lbl_Sales");
                TextBox tbx_Rate  = (TextBox)gr.FindControl("tbx_Rate");
                if (lbl_Sales != null && tbx_Rate != null)
                {
                    item.Rate = decimal.Parse(tbx_Rate.Text);
                }
                item.Amount = decimal.Parse(lbl_Sales.Text) * decimal.Parse(tbx_Rate.Text) / 100;
            }
            item.Amount = Math.Round(item.Amount, 1);
            item.Remark = ((TextBox)gr.FindControl("tbx_Remark")).Text;

            bll.UpdateDetail(item);
        }
        MessageBox.Show(this, "保存成功!");
        BindGrid();
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            if ((int)ViewState["ID"] > 0)
            {
                BindData();
            }
            if (Request.QueryString["ClientID"] != null)
            {
                int clientid = int.Parse(Request.QueryString["ClientID"]);

                MCSSelectControl control = (MCSSelectControl)UC_DetailView1.FindControl("CM_LinkMan_ClientID");
                if (control != null)
                {
                    CM_ClientBLL client = new CM_ClientBLL(clientid);
                    control.SelectValue = clientid.ToString();
                    control.SelectText  = client.Model.FullName;
                    control.Enabled     = false;
                }
            }
        }
    }
    protected void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e)
    {
        #region 限定选择提成计算方法的范围只能是当前片区
        DropDownList ddl_SalaryGrade = (DropDownList)UC_DetailView1.FindControl("PM_Promotor_SalaryGrade");
        if (ddl_SalaryGrade != null)
        {
            try
            {
                ddl_SalaryGrade.DataTextField  = "Name";
                ddl_SalaryGrade.DataValueField = "ID";

                string    orgcitys = "";
                DataTable dt       = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue));
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["ID"].ToString() != "")
                    {
                        orgcitys += "," + dr["ID"].ToString();
                    }
                }
                if (orgcitys.Length > 1)
                {
                    orgcitys = orgcitys.Substring(1, orgcitys.Length - 1);
                }

                ddl_SalaryGrade.DataSource = PM_SalaryLevelBLL.GetModelList("OrganizeCity in (" + orgcitys + ")");
                ddl_SalaryGrade.DataBind();
            }
            catch { }
            ddl_SalaryGrade.Items.Insert(0, new ListItem("请选择", "0"));
        }
        #endregion
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            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());
                }
            }
            #endregion

            BindDropDown();

            if ((int)ViewState["ID"] != 0)
            {
                BindData();
            }
            else
            {
                if (ViewState["ClientID"] != null)
                {
                    MCSSelectControl select_Client = (MCSSelectControl)UC_DetailView1.FindControl("CM_KPI_Client");
                    CM_ClientBLL     client        = new CM_ClientBLL((int)ViewState["ClientID"]);

                    select_Client.SelectValue = ViewState["ClientID"].ToString();
                    select_Client.SelectText  = client.Model.FullName;
                    //select_Client.Enabled = false;
                }

                DropDownList ddl_Month = (DropDownList)UC_DetailView1.FindControl("CM_KPI_AccountMonth");
                ddl_Month.SelectedValue = AC_AccountMonthBLL.GetCurrentMonth().ToString();

                bt_Approve.Visible = false;
                bt_Delete.Visible  = false;
            }
        }
        #region 增加计算合计得分按钮
        if (bt_OK.Visible)
        {
            Label  lb_TotalScore = (Label)UC_DetailView1.FindControl("CM_KPI_TotalScore");
            Button bt_Compute    = new Button();
            bt_Compute.ID     = "bt_Compute";
            bt_Compute.Text   = "计算总分";
            bt_Compute.Click += new EventHandler(bt_Compute_Click);
            lb_TotalScore.Parent.Controls.Add(bt_Compute);
        }
        #endregion
    }
Exemplo n.º 10
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if ((int)ViewState["InventoryID"] != 0)
     {
         DropDownList ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_Inventory_AccountMonth");
         if (int.Parse(ddl_Month.SelectedValue) < AC_AccountMonthBLL.GetCurrentMonth() - 1)
         {
             bt_Re_Approve.Visible = false;
         }
     }
 }
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if ((int)ViewState["PromotorID"] > 0)
     {
         PM_Promotor m = new PM_PromotorBLL((int)ViewState["PromotorID"]).Model;
         if (m.Dimission == 2)
         {
             TextBox txt_BeginWorkDate = (TextBox)UC_DetailView1.FindControl("PM_Promotor_BeginWorkDate");
             txt_BeginWorkDate.Enabled = true;
             //ddl_Classify.Enabled = true;
         }
     }
 }
Exemplo n.º 12
0
    void ddl_ActiveFlag_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList ddl_ActiveFlag = (DropDownList)UC_DetailView1.FindControl("CM_Client_ActiveFlag");

        if (ddl_ActiveFlag.SelectedValue == "2")
        {
            ((TextBox)UC_DetailView1.FindControl("CM_Client_CloseTime")).Text = DateTime.Now.ToString("yyyy-MM-dd");
        }
        else
        {
            ((TextBox)UC_DetailView1.FindControl("CM_Client_CloseTime")).Text = "";
        }
    }
    protected void btn_SalesForcast_Click(object sender, EventArgs e)
    {
        #region 已有分配单展示,没有则生成
        MCSTreeControl   tr_OrganizeCity = (MCSTreeControl)UC_DetailView1.FindControl("SVM_ClassifyForcast_OrganizeCity");
        MCSSelectControl select_Client   = (MCSSelectControl)UC_DetailView1.FindControl("SVM_ClassifyForcast_Client");
        DropDownList     ddl_Month       = (DropDownList)UC_DetailView1.FindControl("SVM_ClassifyForcast_AccountMonth");


        int id = SVM_ClassifyForcastBLL.Init(int.Parse(tr_OrganizeCity.SelectValue), int.Parse(ddl_Month.SelectedValue), int.Parse(select_Client.SelectValue == "" ? "0" : select_Client.SelectValue), (int)Session["UserID"]);

        Response.Redirect("ClassifyForcastDetail.aspx?ForcastID=" + id.ToString());
        #endregion
    }
Exemplo n.º 14
0
    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";
    }
    void ddl_BasePaySubsidyMode_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox tbx_BasePaySubsidy          = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_BasePaySubsidy");
        TextBox tbx_BasePaySubsidyBeginDate = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_BasePaySubsidyBeginDate");
        TextBox tbx_BasePaySubsidyEndDate   = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_BasePaySubsidyEndDate");

        if (tbx_BasePaySubsidy == null || tbx_BasePaySubsidyBeginDate == null || tbx_BasePaySubsidyEndDate == null)
        {
            return;
        }


        switch (ddl_BasePaySubsidyMode.SelectedValue)
        {
        case "0":          //无底薪补贴
            tbx_BasePaySubsidy.Text          = "0";
            tbx_BasePaySubsidyBeginDate.Text = "";
            tbx_BasePaySubsidyEndDate.Text   = "";

            tbx_BasePaySubsidy.Enabled          = false;
            tbx_BasePaySubsidyBeginDate.Enabled = false;
            tbx_BasePaySubsidyEndDate.Enabled   = false;
            break;

        case "1":          //临时补贴
            if (tbx_BasePaySubsidyBeginDate.Text == "")
            {
                tbx_BasePaySubsidyBeginDate.Text = new AC_AccountMonthBLL
                                                       (AC_AccountMonthBLL.GetCurrentMonth()).Model.EndDate.AddDays(1).ToString("yyyy-MM-dd");
            }

            tbx_BasePaySubsidy.Enabled          = true;
            tbx_BasePaySubsidyBeginDate.Enabled = true;
            tbx_BasePaySubsidyEndDate.Enabled   = true;
            break;

        case "2":          //长期固定补贴
            if (tbx_BasePaySubsidyBeginDate.Text == "")
            {
                tbx_BasePaySubsidyBeginDate.Text = new AC_AccountMonthBLL
                                                       (AC_AccountMonthBLL.GetCurrentMonth()).Model.EndDate.AddDays(1).ToString("yyyy-MM-dd");
            }
            tbx_BasePaySubsidyEndDate.Text = "";

            tbx_BasePaySubsidy.Enabled          = true;
            tbx_BasePaySubsidyBeginDate.Enabled = true;
            tbx_BasePaySubsidyEndDate.Enabled   = false;
            break;
        }
    }
Exemplo n.º 16
0
    private decimal ComputeTotalScore()
    {
        decimal score = 0;

        for (int i = 1; i <= 6; i++)
        {
            TextBox tbx = (TextBox)UC_DetailView1.FindControl("CM_KPI_KPI" + i.ToString());

            if (tbx.Text != "")
            {
                score += decimal.Parse(tbx.Text);
            }
        }

        return(score);
    }
    void ddl_MinimumWageMode_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox tbx_MinimumWage          = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_MinimumWage");
        TextBox tbx_MinimumWageBeginDate = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_MinimumWageBeginDate");
        TextBox tbx_MinimumWageEndDate   = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_MinimumWageEndDate");

        if (tbx_MinimumWage == null || tbx_MinimumWageBeginDate == null || tbx_MinimumWageEndDate == null)
        {
            return;
        }

        switch (ddl_MinimumWageMode.SelectedValue)
        {
        case "0":          //无保底
            tbx_MinimumWage.Text          = "0";
            tbx_MinimumWageBeginDate.Text = "";
            tbx_MinimumWageEndDate.Text   = "";

            tbx_MinimumWage.Enabled          = false;
            tbx_MinimumWageBeginDate.Enabled = false;
            tbx_MinimumWageEndDate.Enabled   = false;
            break;

        case "1":      //标准保底
            if (tbx_MinimumWageBeginDate.Text == "")
            {
                tbx_MinimumWageBeginDate.Text = new AC_AccountMonthBLL
                                                    (AC_AccountMonthBLL.GetCurrentMonth()).Model.EndDate.AddDays(1).ToString("yyyy-MM-dd");
            }

            #region 系统根据导购员所在区域属性自动设定标准保底额
            decimal MinumumWage = (decimal)ViewState["MinumumWage"];
            tbx_MinimumWage.Text = MinumumWage.ToString("0.##");
            #endregion

            tbx_MinimumWage.Enabled          = false;
            tbx_MinimumWageBeginDate.Enabled = true;
            tbx_MinimumWageEndDate.Enabled   = true;
            break;

        case "2":      //特殊保底
            tbx_MinimumWage.Enabled          = true;
            tbx_MinimumWageBeginDate.Enabled = true;
            tbx_MinimumWageEndDate.Enabled   = true;
            break;
        }
    }
Exemplo n.º 18
0
    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();
            }
        }
    }
Exemplo n.º 19
0
    protected void btn_Inventory_Click(object sender, EventArgs e)
    {
        #region 创建空的销量列表
        MCSSelectControl select_Client = (MCSSelectControl)UC_DetailView1.FindControl("SVM_Inventory_Client");
        DropDownList     ddl_Month     = (DropDownList)UC_DetailView1.FindControl("SVM_Inventory_AccountMonth");

        if (select_Client.SelectValue != "")
        {
            TextBox tbx_InventoryDate = (TextBox)UC_DetailView1.FindControl("SVM_Inventory_InventoryDate");
            if (tbx_InventoryDate != null)
            {
                int id = SVM_InventoryBLL.InitProductList(int.Parse(ddl_Month.SelectedValue), int.Parse(select_Client.SelectValue), DateTime.Parse(tbx_InventoryDate.Text), (int)Session["UserID"], (bool)ViewState["IsCXP"]); //空的

                Response.Redirect("InventoryBatchInput.aspx?InventoryID=" + id.ToString() + "&Flag=1&IsCXP=" + ((bool)ViewState["IsCXP"] ? "1" : "0"));
            }
        }
        #endregion
    }
Exemplo n.º 20
0
    private void Save()
    {
        SVM_SalesForcastBLL bll       = new SVM_SalesForcastBLL((int)ViewState["ForcastID"]);
        DropDownList        ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_SalesForcast_AccountMonth");

        bll.Model.AccountMonth = int.Parse(ddl_Month.SelectedValue);
        bll.Update();
        foreach (GridViewRow gr in gv_List.Rows)
        {
            int id = (int)gv_List.DataKeys[gr.RowIndex][0];
            SVM_SalesForcast_Detail item = bll.GetDetailModel(id);
            item.Quantity = int.Parse(((TextBox)gr.FindControl("tbx_Quantity1")).Text) * new PDT_ProductBLL(item.Product).Model.ConvertFactor +
                            int.Parse(((TextBox)gr.FindControl("tbx_Quantity2")).Text);
            item.Remark = ((TextBox)gr.FindControl("tbx_Remark")).Text;

            bll.UpdateDetail(item);
        }
    }
Exemplo n.º 21
0
    protected void btn_SalesTarget_Click(object sender, EventArgs e)
    {
        #region 已有分配单展示,没有则生成
        MCSTreeControl   tr_OrganizeCity = (MCSTreeControl)UC_DetailView1.FindControl("SVM_SalesTarget_OrganizeCity");
        MCSSelectControl select_Client   = (MCSSelectControl)UC_DetailView1.FindControl("SVM_SalesTarget_Client");
        DropDownList     ddl_Month       = (DropDownList)UC_DetailView1.FindControl("SVM_SalesTarget_AccountMonth");

        if (tr_OrganizeCity.SelectValue == "0" || select_Client.SelectValue == "")
        {
            lb_Msg.Text = "必填先选择要填报的客户!";
            MessageBox.Show(this, "必填先选择要填报的客户!" + tr_OrganizeCity.SelectValue + "|" + select_Client.SelectValue);
            return;
        }
        int id = SVM_SalesTargetBLL.InitProductList(int.Parse(tr_OrganizeCity.SelectValue), int.Parse(ddl_Month.SelectedValue), int.Parse(select_Client.SelectValue == "" ? "0" : select_Client.SelectValue), (int)Session["UserID"]);

        Response.Redirect("SalesTargetDetail.aspx?TargetID=" + id.ToString());
        #endregion
    }
    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;
        }
    }
    private void BindDropDown()
    {
        IList <Right_Action> actions = Right_ActionBLL.GetModelList("Module=" + new UD_WebPageBLL((Guid)ViewState["WebPageID"]).Model.Module.ToString());
        DropDownList         ddl_VisibleActionCode = (DropDownList)UC_DetailView1.FindControl("UD_WebPageControl_VisibleActionCode");
        DropDownList         ddl_EnableActionCode  = (DropDownList)UC_DetailView1.FindControl("UD_WebPageControl_EnableActionCode");


        ddl_VisibleActionCode.DataTextField  = "Name";
        ddl_VisibleActionCode.DataValueField = "Code";
        ddl_VisibleActionCode.DataSource     = actions;
        ddl_VisibleActionCode.DataBind();
        ddl_VisibleActionCode.Items.Insert(0, new ListItem("请选择", "0"));

        ddl_EnableActionCode.DataTextField  = "Name";
        ddl_EnableActionCode.DataValueField = "Code";
        ddl_EnableActionCode.DataSource     = actions;
        ddl_EnableActionCode.DataBind();
        ddl_EnableActionCode.Items.Insert(0, new ListItem("请选择", "0"));
    }
 protected void ddl_BankType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (txt_BankName != null)
     {
         int val = int.Parse(ddl_BankType.SelectedValue);
         txt_BankName.Enabled = val > 2;
         txt_BankName.Text    = val > 2 ? "" : ddl_BankType.SelectedItem.Text;
         TextBox tbx_BankAccountNo = (TextBox)UC_DetailView1.FindControl("PM_Promotor_AccountCode");
         if (val == 1 && (tbx_BankAccountNo.Text.Trim().StartsWith("6228") || tbx_BankAccountNo.Text.Trim().StartsWith("9559")))
         {
             MessageBox.Show(this, "所填账号非建行卡号,请重新选择!");
             txt_BankName.Text = ""; ddl_BankType.SelectedIndex = 0;
         }
         else if (val == 2 && !tbx_BankAccountNo.Text.Trim().StartsWith("6228") && !tbx_BankAccountNo.Text.Trim().StartsWith("9559"))
         {
             MessageBox.Show(this, "所填账号非农行卡号,请重新选择!");
             txt_BankName.Text = ""; ddl_BankType.SelectedIndex = 0;
         }
     }
 }
    void ddl_InsuranceMode_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList ddl_InsuranceSubsidy = (DropDownList)UC_DetailView1.FindControl("PM_PromotorSalary_InsuranceSubsidy");

        if (ddl_InsuranceSubsidy == null)
        {
            return;
        }

        if (ddl_InsuranceMode.SelectedValue == "1")
        {
            //自购社保,给予补贴
            ddl_InsuranceSubsidy.Enabled = true;
        }
        else
        {
            ddl_InsuranceSubsidy.SelectedValue = "0";
            ddl_InsuranceSubsidy.Enabled       = false;
        }
    }
Exemplo n.º 26
0
    protected void Save()
    {
        SVM_InventoryBLL bll       = new SVM_InventoryBLL((int)ViewState["InventoryID"]);
        DropDownList     ddl_Month = (DropDownList)UC_DetailView1.FindControl("SVM_Inventory_AccountMonth");

        bll.Model.InventoryDate = DateTime.Now.Date;
        bll.Model.AccountMonth  = int.Parse(ddl_Month.SelectedValue);
        bll.Model["SubmitFlag"] = "2";
        bll.Update();
        foreach (GridViewRow gr in gv_List.Rows)
        {
            int id = (int)gv_List.DataKeys[gr.RowIndex][0];
            SVM_Inventory_Detail item = bll.GetDetailModel(id);

            item.Quantity = int.Parse(((TextBox)gr.FindControl("tbx_Quantity1")).Text) * new PDT_ProductBLL(item.Product).Model.ConvertFactor +
                            int.Parse(((TextBox)gr.FindControl("tbx_Quantity2")).Text);
            item.Remark = ((TextBox)gr.FindControl("tbx_Remark")).Text;

            bll.UpdateDetail(item);
        }
    }
Exemplo n.º 27
0
    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());
        }
    }
Exemplo n.º 28
0
    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
        }
    }
    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);
        }
    }
Exemplo n.º 30
0
    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;
    }