protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPJiXiao Model = new ZWL.BLL.ERPJiXiao(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblJXName.Text = Model.JXName.ToString(); this.lblJianJie.Text = Model.JianJie.ToString(); this.lblUserName.Text = Model.UserName.ToString(); this.lblTimeStr.Text = Model.TimeStr.ToString(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户查看绩效考核信息(" + this.lblJXName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //获取动态参数项 DataSet CanShuDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ItemName,ID from ERPJiXiaoCanShu order by BackInfo"); //绑定数据到列表中 DataSet UserDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser order by UserName asc"); //合计特殊行 string HeJiStr = "<tr><td align=center height=30px style=\"background-color: #ffffff\">合计</td><td align=center style=\"background-color: #ffffff\"></td>"; //生成表格头!!!!! Label1.Text = "<table width=100% bgcolor=\"#999999\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" ><tr><td align=center height=30px style=\"background-color: #ffffff\">序号</td><td align=center style=\"background-color: #ffffff\">用户名</td>"; for (int i = 0; i < CanShuDT.Tables[0].Rows.Count; i++) { Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\">" + CanShuDT.Tables[0].Rows[i]["ItemName"].ToString() + "</td>"; HeJiStr = HeJiStr + "<td align=center style=\"background-color: #ffffff\">" + GetFenXiangHeJi(i.ToString(), UserDT, CanShuDT) + "</td>"; } Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\">小计</td></tr>"; HeJiStr = HeJiStr + "<td align=center style=\"background-color: #ffffff\">" + GetZongTiHeJi(UserDT, CanShuDT) + "</td></tr>"; //生成数据项 for (int j = 0; j < UserDT.Tables[0].Rows.Count; j++) { Label1.Text = Label1.Text + "<tr><td align=center height=30px style=\"background-color: #ffffff\">" + (j + 1).ToString() + "</td>"; Label1.Text = Label1.Text + "<td align=center height=30px style=\"background-color: #ffffff\">" + UserDT.Tables[0].Rows[j]["UserName"].ToString() + "</td>"; for (int K = 0; K < CanShuDT.Tables[0].Rows.Count; K++) { Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\"><INPUT readOnly style=\"border:0px\" value=\"" + ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 NumStr from ERPJXDetails where JXID=" + Request.QueryString["ID"].ToString() + " and ItemsID=" + CanShuDT.Tables[0].Rows[K]["ID"].ToString() + " and UserName='******'") + "\" id=InP-" + j.ToString() + "-" + K.ToString() + " name=InP-" + UserDT.Tables[0].Rows[j]["UserName"].ToString() + "-" + CanShuDT.Tables[0].Rows[K]["ID"].ToString() + " SIZE=10></td>"; } Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\">" + GetUserXiaoJi(j.ToString(), UserDT, CanShuDT) + "</td>"; } Label1.Text = Label1.Text + "</tr>"; Label1.Text = Label1.Text + HeJiStr + "</table>"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPJiXiao Model = new ZWL.BLL.ERPJiXiao(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblJXName.Text=Model.JXName.ToString(); this.lblJianJie.Text=Model.JianJie.ToString(); this.lblUserName.Text=Model.UserName.ToString(); this.lblTimeStr.Text=Model.TimeStr.ToString(); //дϵͳ��־ ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "�û��鿴��Ч������Ϣ(" + this.lblJXName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //��ȡ��̬������ DataSet CanShuDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ItemName,ID from ERPJiXiaoCanShu order by BackInfo"); //�����ݵ��б��� DataSet UserDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser order by UserName asc"); //�ϼ������� string HeJiStr = "<tr><td align=center height=30px style=\"background-color: #ffffff\">�ϼ�</td><td align=center style=\"background-color: #ffffff\"></td>"; //���ɱ��ͷ���������� Label1.Text = "<table width=100% bgcolor=\"#999999\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" ><tr><td align=center height=30px style=\"background-color: #ffffff\">���</td><td align=center style=\"background-color: #ffffff\">�û���</td>"; for (int i = 0; i < CanShuDT.Tables[0].Rows.Count; i++) { Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\">" + CanShuDT.Tables[0].Rows[i]["ItemName"].ToString() + "</td>"; HeJiStr = HeJiStr + "<td align=center style=\"background-color: #ffffff\">" + GetFenXiangHeJi(i.ToString(), UserDT, CanShuDT) + "</td>"; } Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\">С��</td></tr>"; HeJiStr = HeJiStr + "<td align=center style=\"background-color: #ffffff\">" + GetZongTiHeJi(UserDT, CanShuDT) + "</td></tr>"; //���������� for (int j = 0; j < UserDT.Tables[0].Rows.Count; j++) { Label1.Text = Label1.Text + "<tr><td align=center height=30px style=\"background-color: #ffffff\">" + (j + 1).ToString() + "</td>"; Label1.Text = Label1.Text + "<td align=center height=30px style=\"background-color: #ffffff\">" + UserDT.Tables[0].Rows[j]["UserName"].ToString() + "</td>"; for (int K = 0; K < CanShuDT.Tables[0].Rows.Count; K++) { Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\"><INPUT readOnly style=\"border:0px\" value=\"" + ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 NumStr from ERPJXDetails where JXID=" + Request.QueryString["ID"].ToString() + " and ItemsID=" + CanShuDT.Tables[0].Rows[K]["ID"].ToString() + " and UserName='******'") + "\" id=InP-" + j.ToString() + "-" + K.ToString() + " name=InP-" + UserDT.Tables[0].Rows[j]["UserName"].ToString() + "-" + CanShuDT.Tables[0].Rows[K]["ID"].ToString() + " SIZE=10></td>"; } Label1.Text = Label1.Text + "<td align=center style=\"background-color: #ffffff\">" + GetUserXiaoJi(j.ToString(), UserDT, CanShuDT) + "</td>"; } Label1.Text = Label1.Text + "</tr>"; Label1.Text = Label1.Text + HeJiStr + "</table>"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPJiXiao Model = new ZWL.BLL.ERPJiXiao(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.txtJXName.Text = Model.JXName.ToString(); this.txtJianJie.Text = Model.JianJie.ToString(); this.txtUserName.Text = Model.UserName.ToString(); this.txtTimeStr.Text = Model.TimeStr.ToString(); DataBindToGridview(); } }
public void DataBindToGridview(string IDList) { ZWL.BLL.ERPJiXiao MyModel = new ZWL.BLL.ERPJiXiao(); if (IDList.Trim().Length > 0) { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' and ID in(" + IDList + ") order by ID desc"); } else { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' order by ID desc"); } GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPJiXiao Model = new ZWL.BLL.ERPJiXiao(); Model.ID = int.Parse(Request.QueryString["ID"].ToString()); Model.JXName = this.txtJXName.Text.ToString(); Model.JianJie = this.txtJianJie.Text.ToString(); Model.UserName = this.txtUserName.Text.ToString(); Model.TimeStr = DateTime.Parse(this.txtTimeStr.Text); Model.Update(); //写入考核详细记录表中!!!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //获取动态参数项 DataSet CanShuDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ItemName,ID from ERPJiXiaoCanShu order by BackInfo"); //绑定数据到列表中 DataSet UserDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser order by UserName asc"); //清空上一次的详细记录,然后重新添加。 ZWL.DBUtility.DbHelperSQL.ExecuteSQL("delete from ERPJXDetails where JXID=" + Request.QueryString["ID"].ToString()); //插入数据到数据表 for (int j = 0; j < UserDT.Tables[0].Rows.Count; j++) { for (int K = 0; K < CanShuDT.Tables[0].Rows.Count; K++) { //添加最新的考核数据 ZWL.BLL.ERPJXDetails MyModel = new ZWL.BLL.ERPJXDetails(); MyModel.JXID = int.Parse(Request.QueryString["ID"].ToString()); MyModel.ItemsID = int.Parse(CanShuDT.Tables[0].Rows[K]["ID"].ToString()); MyModel.UserName = UserDT.Tables[0].Rows[j]["UserName"].ToString(); MyModel.NumStr = Request.Form["InP-" + UserDT.Tables[0].Rows[j]["UserName"].ToString() + "-" + CanShuDT.Tables[0].Rows[K]["ID"].ToString()].ToString(); MyModel.Add(); } } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户修改绩效考核信息(" + this.txtJXName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "绩效考核信息修改成功!", "JiXiao.aspx"); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPJiXiao Model = new ZWL.BLL.ERPJiXiao(); Model.JXName=this.txtJXName.Text.ToString(); Model.JianJie=this.txtJianJie.Text.ToString(); Model.UserName=ZWL.Common.PublicMethod.GetSessionValue("UserName"); Model.TimeStr=DateTime.Now; int JXIDStr=Model.Add(); //д�뿼����ϸ��¼���У����������� //��ȡ��̬������ DataSet CanShuDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ItemName,ID from ERPJiXiaoCanShu order by BackInfo"); //�����ݵ��б��� DataSet UserDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser order by UserName asc"); //�������ݵ����ݱ� for (int j = 0; j < UserDT.Tables[0].Rows.Count; j++) { for (int K = 0; K < CanShuDT.Tables[0].Rows.Count; K++) { ZWL.BLL.ERPJXDetails MyModel = new ZWL.BLL.ERPJXDetails(); MyModel.JXID = JXIDStr; MyModel.ItemsID = int.Parse(CanShuDT.Tables[0].Rows[K]["ID"].ToString()); MyModel.UserName = UserDT.Tables[0].Rows[j]["UserName"].ToString(); MyModel.NumStr = Request.Form["InP-" + UserDT.Tables[0].Rows[j]["UserName"].ToString() + "-" + CanShuDT.Tables[0].Rows[K]["ID"].ToString()].ToString(); MyModel.Add(); } } //дϵͳ��־ ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "�û���Ӽ�Ч������Ϣ(" + this.txtJXName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "��Ч������Ϣ��ӳɹ���", "JiXiao.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPJiXiao Model = new ZWL.BLL.ERPJiXiao(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.txtJXName.Text=Model.JXName.ToString(); this.txtJianJie.Text=Model.JianJie.ToString(); this.txtUserName.Text=Model.UserName.ToString(); this.txtTimeStr.Text=Model.TimeStr.ToString(); DataBindToGridview(); } }