Ejemplo n.º 1
0
    private void BindData()
    {
        CM_KPI m = new CM_KPIBLL((int)ViewState["ID"]).Model;

        UC_DetailView1.BindData(m);

        if (m.ApproveFlag == 1)
        {
            bt_OK.Visible      = false;
            bt_Approve.Visible = false;
            bt_Delete.Visible  = false;
            UC_DetailView1.SetControlsEnable(false);
        }
        else
        {
            //#region 增加计算合计得分按钮
            //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
        }
    }
Ejemplo n.º 2
0
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        CM_KPIBLL _bll = null;
        if ((int)ViewState["ID"] == 0)
            _bll = new CM_KPIBLL();
        else
            _bll = new CM_KPIBLL((int)ViewState["ID"]);

        UC_DetailView1.GetData(_bll.Model);
        _bll.Model.TotalScore = ComputeTotalScore();

        #region 判断必填项
        if (_bll.Model.Client == 0)
        {
            MessageBox.Show(this, "经销商必填!");
            return;
        }
        #endregion

        if ((int)ViewState["ID"] == 0)
        {
            _bll.Model.InsertStaff = (int)Session["UserID"];
            _bll.Model.ApproveFlag = 2;
            ViewState["ID"] = _bll.Add();
        }
        else
        {
            _bll.Model.UpdateStaff = (int)Session["UserID"];
            _bll.Update();
        }

        MessageBox.ShowAndRedirect(this, "保存经销商KPI考核资料成功!", "KPIList.aspx?ClientID=" + _bll.Model.Client.ToString());
    }
Ejemplo n.º 3
0
 protected void bt_Delete_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ID"] != 0)
     {
         CM_KPIBLL _bll = new CM_KPIBLL((int)ViewState["ID"]);
         _bll.Delete();
         MessageBox.ShowAndRedirect(this, "删除经销商KPI资料成功!", "KPIList.aspx");
     }
 }
Ejemplo n.º 4
0
 protected void bt_Delete_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ID"] != 0)
     {
         CM_KPIBLL _bll = new CM_KPIBLL((int)ViewState["ID"]);
         _bll.Delete();
         MessageBox.ShowAndRedirect(this, "删除经销商KPI资料成功!", "KPIList.aspx");
     }
 }
Ejemplo n.º 5
0
 protected void bt_Approve_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ID"] != 0)
     {
         CM_KPIBLL _bll = new CM_KPIBLL((int)ViewState["ID"]);
         _bll.Model.ApproveFlag = 1;
         _bll.Update();
         MessageBox.ShowAndRedirect(this, "审核经销商KPI资料成功!", "KPIList.aspx?ClientID=" + _bll.Model.Client.ToString());
     }
 }
Ejemplo n.º 6
0
 protected void bt_Approve_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ID"] != 0)
     {
         CM_KPIBLL _bll = new CM_KPIBLL((int)ViewState["ID"]);
         _bll.Model.ApproveFlag = 1;
         _bll.Update();
         MessageBox.ShowAndRedirect(this, "审核经销商KPI资料成功!", "KPIList.aspx?ClientID=" + _bll.Model.Client.ToString());
     }
 }
Ejemplo n.º 7
0
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        CM_KPIBLL _bll = null;

        if ((int)ViewState["ID"] == 0)
        {
            _bll = new CM_KPIBLL();
        }
        else
        {
            _bll = new CM_KPIBLL((int)ViewState["ID"]);
        }

        UC_DetailView1.GetData(_bll.Model);
        _bll.Model.TotalScore = ComputeTotalScore();

        #region 判断必填项
        if (_bll.Model.Client == 0)
        {
            MessageBox.Show(this, "经销商必填!");
            return;
        }
        #endregion


        if ((int)ViewState["ID"] == 0)
        {
            _bll.Model.InsertStaff = (int)Session["UserID"];
            _bll.Model.ApproveFlag = 2;
            ViewState["ID"]        = _bll.Add();
        }
        else
        {
            _bll.Model.UpdateStaff = (int)Session["UserID"];
            _bll.Update();
        }

        MessageBox.ShowAndRedirect(this, "保存经销商KPI考核资料成功!", "KPIList.aspx?ClientID=" + _bll.Model.Client.ToString());
    }
Ejemplo n.º 8
0
    private void BindData()
    {
        CM_KPI m = new CM_KPIBLL((int)ViewState["ID"]).Model;
        UC_DetailView1.BindData(m);

        if (m.ApproveFlag == 1)
        {
            bt_OK.Visible = false;
            bt_Approve.Visible = false;
            bt_Delete.Visible = false;
            UC_DetailView1.SetControlsEnable(false);
        }
        else
        {
            //#region 增加计算合计得分按钮
            //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
        }
    }