Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         this.AddButton.Attributes.Add("OnClick", "JavaScript:OpenSmallWindow('SelectScoreDept.aspx?Type=Add&UserCode=" + user.UserCode + "','RecordAdd')");
         this.ModifyButton.Attributes.Add("OnClick", "JavaScript:OpenSmallWindow('SelectScoreDept.aspx?Type=Modify&UserCode=" + user.UserCode + "','RecordModify')");
         this.InitDeptDropDownList(user.UserCode);
         string deptCode = this.DeptDropDownList.SelectedValue;
         lsModel = smBFL.GetEmployScore(deptCode);
         if (lsModel != null)
         {
             count = lsModel.Count;
             this.GridView1.DataSource = lsModel;
             this.GridView1.DataBind();
             if (lsModel != null && lsModel.Count != 0)
             {
                 dt = DateTime.Parse(lsModel[0].MarkTime);
                 ViewState["Time"] = dt.ToString();
                 deptName          = lsModel[0].DeptName;
             }
         }
         else
         {
             dt = DateTime.Now;
             ViewState["Time"] = dt.ToString();
         }
     }
     this.InitButtonAndOtherVisble();
 }
Ejemplo n.º 2
0
    public string[] WriteEmployScore(string dept)
    {
        string[]      tempStrArray = new string[2];
        StringBuilder sbUserName   = new StringBuilder();
        StringBuilder sbUserScore  = new StringBuilder();

        lsESModel = bfl.GetEmployScore(dept, dt, st);
        if (lsESModel == null || lsESModel.Count == 0)
        {
            tempStrArray[0] = "";
            tempStrArray[1] = "";
        }
        else
        {
            for (int i = 0; i < lsESModel.Count; i++)
            {
                sbUserName.Append("<tr><td style=\"border-right:0px;\" align=\"center\">" + lsESModel[i].UserName + "</td></tr>");
                sbUserScore.Append("<tr><td style=\"border-right:0px;\" align=\"center\">" + lsESModel[i].Score + "</td></tr>");
            }
        }
        tempStrArray[0] = sbUserName.ToString();
        tempStrArray[1] = sbUserScore.ToString();
        return(tempStrArray);
    }