Ejemplo n.º 1
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        RS_ScoreManageBFL   smBFL       = new RS_ScoreManageBFL();
        RS_EmployScoreBFL   esBFL       = new RS_EmployScoreBFL();
        RS_EmployScoreModel es          = new RS_EmployScoreModel();
        RS_ScoreManageModel tempSmModel = new RS_ScoreManageModel();

        //tempSmModel.DeptCode = Request.QueryString["UnitCode"];
        tempSmModel.Marker = user.UserCode;
        //tempSmModel.MarkDate = smBFL.GetMonthFirstDate(DateTime.Now);
        tempSmModel.MarkDate = dt;
        tempSmModel.Type     = Int32.Parse(ScoreType.Manager.ToString("d"));
        tempSmModel.Status   = WorkFlowStatus.Apply.ToString("d").ToString();
        int tempCode = smBFL.Insert(tempSmModel);

        foreach (GridViewRow gvRow in GridView1.Rows)
        {
            int score = -1;
            es = new RS_EmployScoreModel();
            TextBox tbScore = (TextBox)(gvRow.FindControl("ScoreTextBox"));
            //HtmlInputHidden hidUserCode = (HtmlInputHidden)(gvRow.FindControl("HidUserCode"));
            //es.UserCode = hidUserCode.Value;
            es.UserCode = gvRow.Cells[1].Text;
            Int32.TryParse(tbScore.Text, out score);
            es.Score      = score;
            es.ManageCode = tempCode;
            esBFL         = new RS_EmployScoreBFL();
            esBFL.Insert(es);
        }
        Response.Redirect("RS_ScoreForManagerEdit.aspx?FKCode=" + tempCode.ToString() + "&UserCode=" + user.UserCode + "");
    }
Ejemplo n.º 2
0
    public void SaveButton_Click(object sender, EventArgs e)
    {
        RS_ScoreManageModel smModel = new RS_ScoreManageModel();
        RS_EmployScoreModel esModel = new RS_EmployScoreModel();
        RS_EmployScoreBFL   esBFL;

        smModel.MarkDate = bfl.GetMonthFirstDate(DateTime.Now);
        smModel.Marker   = user.UserCode;
        smModel.Status   = WorkFlowStatus.Audited.ToString("d");
        smModel.Type     = Int32.Parse(ScoreType.Dept.ToString("d"));
        int manageCode = bfl.Insert(smModel);

        foreach (GridViewRow gvRow in GridView1.Rows)
        {
            HtmlInputHidden hidDeptCode = (HtmlInputHidden)(gvRow.FindControl("HidUnitCode"));
            TextBox         tbScore     = (TextBox)(gvRow.FindControl("ScoreTextBox"));
            esModel.ManageCode = manageCode;
            esModel.UserCode   = hidDeptCode.Value;
            int score = 1;
            Int32.TryParse(tbScore.Text.Trim(), out score);
            esModel.Score = score;
            esBFL         = new RS_EmployScoreBFL();
            esBFL.Insert(esModel);
        }

        Response.Write("<script> window.opener.location.reload();window.close();</script>");
    }