Ejemplo n.º 1
0
    protected void btn_Salary_AddLevel_Click(object sender, EventArgs e)
    {
        PM_SalaryLevelBLL bll = null;

        if (btn_Salary_AddLevel.Text == "添  加")
        {
            bll = new PM_SalaryLevelBLL();
            bll.Model.InputStaff = (int)Session["UserID"];
        }
        else
        {
            bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
            bll.Model.UpdateStaff = (int)Session["UserID"];
        }
        panel2.GetData(bll.Model);
        if (btn_Salary_AddLevel.Text == "添  加")
        {
            bll.Model.ApproveFlag = 2;
            ViewState["ID"]       = bll.Add();
        }
        else
        {
            bll.Update();
        }
        BindData();
        Response.Redirect("PM_SalaryLevelDetail.aspx?ID=" + (int)ViewState["ID"]);
    }
    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
    }
    protected void btn_Salary_AddLevel_Click(object sender, EventArgs e)
    {
        PM_SalaryLevelBLL bll = null;
        if (btn_Salary_AddLevel.Text == "添  加")
        {
            bll = new PM_SalaryLevelBLL();
            bll.Model.InputStaff = (int)Session["UserID"];

        }
        else
        {
            bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
            bll.Model.UpdateStaff = (int)Session["UserID"];
        }
        panel2.GetData(bll.Model);
        if (btn_Salary_AddLevel.Text == "添  加")
        {
            bll.Model.ApproveFlag = 2;
            ViewState["ID"] = bll.Add();
        }
        else
        {
            bll.Update();
        }
        BindData();
        Response.Redirect("PM_SalaryLevelDetail.aspx?ID=" + (int)ViewState["ID"]);
    }
 public void BindData()
 {
     PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
     //panel1.BindData(bll.Model);
     panel2.BindData(bll.Model);
     ud_grid_salary.ConditionString = " MCS_Promotor.dbo.PM_SalaryLevelDetail.LevelID= " + (int)ViewState["ID"];
     ud_grid_salary.BindGrid();
 }
Ejemplo n.º 5
0
    public void BindData()
    {
        PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);

        //panel1.BindData(bll.Model);
        panel2.BindData(bll.Model);
        ud_grid_salary.ConditionString = " MCS_Promotor.dbo.PM_SalaryLevelDetail.LevelID= " + (int)ViewState["ID"];
        ud_grid_salary.BindGrid();
    }
Ejemplo n.º 6
0
    protected void btn_Salary_ApprovLevel_Click(object sender, EventArgs e)
    {
        PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);

        bll.Model.ApproveFlag = 1;
        bll.Model.UpdateStaff = (int)Session["UserID"];
        bll.Update();
        BindData();
    }
 protected void btn_Salary_AddRate_Click(object sender, EventArgs e)
 {
     PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
     PM_SalaryLevelDetail item=new PM_SalaryLevelDetail();
     item.Complete1 = decimal.Parse(this.txt_kswcl.Text);
     item.Complete2 = decimal.Parse(this.txt_jzwcl.Text);
     item.Rate = decimal.Parse(this.txt_tcxs.Text);
     bll.AddDetail(item);
     this.txt_kswcl.Text = this.txt_jzwcl.Text;
     this.txt_tcxs.Text = "";
     this.txt_jzwcl.Text = "";
     BindData();
 }
Ejemplo n.º 8
0
    protected void btn_Salary_AddRate_Click(object sender, EventArgs e)
    {
        PM_SalaryLevelBLL    bll  = new PM_SalaryLevelBLL((int)ViewState["ID"]);
        PM_SalaryLevelDetail item = new PM_SalaryLevelDetail();

        item.Complete1 = decimal.Parse(this.txt_kswcl.Text);
        item.Complete2 = decimal.Parse(this.txt_jzwcl.Text);
        item.Rate      = decimal.Parse(this.txt_tcxs.Text);
        bll.AddDetail(item);
        this.txt_kswcl.Text = this.txt_jzwcl.Text;
        this.txt_tcxs.Text  = "";
        this.txt_jzwcl.Text = "";
        BindData();
    }
Ejemplo n.º 9
0
    protected void btn_del_levelRate_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow gr in ud_grid_salary.Rows)
        {
            if (((CheckBox)gr.FindControl("chk_ID")).Checked == true)
            {
                int id = int.Parse(ud_grid_salary.DataKeys[gr.RowIndex]["PM_SalaryLevelDetail_ID"].ToString());

                PM_SalaryLevelBLL    bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
                PM_SalaryLevelDetail pm  = new PM_SalaryLevelDetail();
                bll.DeleteDetail(id);

                //ListTable<PM_SalaryLevelDetail> _details = ViewState["Details"] as ListTable<PM_SalaryLevelDetail>;
                //_details.Remove(id.ToString());
                //ViewState["Details"] = _details;

                //PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
                //bll.Model.ID = (int)ViewState["ID"];
                ////PM_SalaryLevelDetail iitem = new PM_SalaryLevelDetail(int.Parse(ud_grid.DataKeys[gr.RowIndex]["ID"].ToString()));
                //bll.DeleteDetail();
            }
        }
        BindData();
    }
    protected void btn_del_levelRate_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow gr in ud_grid_salary.Rows)
        {
            if (((CheckBox)gr.FindControl("chk_ID")).Checked == true)
            {
                int id = int.Parse(ud_grid_salary.DataKeys[gr.RowIndex]["PM_SalaryLevelDetail_ID"].ToString());

                PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
                PM_SalaryLevelDetail pm = new PM_SalaryLevelDetail();
                bll.DeleteDetail(id);

                //ListTable<PM_SalaryLevelDetail> _details = ViewState["Details"] as ListTable<PM_SalaryLevelDetail>;
                //_details.Remove(id.ToString());
                //ViewState["Details"] = _details;

                //PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
                //bll.Model.ID = (int)ViewState["ID"];
                ////PM_SalaryLevelDetail iitem = new PM_SalaryLevelDetail(int.Parse(ud_grid.DataKeys[gr.RowIndex]["ID"].ToString()));
                //bll.DeleteDetail();
            }
        }
        BindData();
    }
 protected void btn_Salary_ApprovLevel_Click(object sender, EventArgs e)
 {
     PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]);
     bll.Model.ApproveFlag = 1;
     bll.Model.UpdateStaff = (int)Session["UserID"];
     bll.Update();
     BindData();
 }