protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPXinChou Model = new ZWL.BLL.ERPXinChou(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblXCName.Text=Model.XCName.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.lblXCName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //��ȡ��̬������ DataSet CanShuDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ItemName,ID from ERPXinChouCanShu 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 ERPXCDetails where XCID=" + 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.ERPXinChou Model = new ZWL.BLL.ERPXinChou(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.lblXCName.Text = Model.XCName.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.lblXCName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //获取动态参数项 DataSet CanShuDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ItemName,ID from ERPXinChouCanShu order by BackInfo"); //绑定数据到列表中 DataSet UserDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser where UserName='******' 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 ERPXCDetails where XCID=" + 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.ERPXinChou Model = new ZWL.BLL.ERPXinChou(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.txtXCName.Text = Model.XCName.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.ERPXinChou MyModel = new ZWL.BLL.ERPXinChou(); 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.ERPXinChou Model = new ZWL.BLL.ERPXinChou(); Model.ID = int.Parse(Request.QueryString["ID"].ToString()); Model.XCName = this.txtXCName.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 ERPXinChouCanShu order by BackInfo"); //绑定数据到列表中 DataSet UserDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser order by UserName asc"); //清空上一次的详细记录,然后重新添加。 ZWL.DBUtility.DbHelperSQL.ExecuteSQL("delete from ERPXCDetails where XCID=" + 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.ERPXCDetails MyModel = new ZWL.BLL.ERPXCDetails(); MyModel.XCID = 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.txtXCName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "薪酬数据信息修改成功!", "XinChou.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPXinChou Model = new ZWL.BLL.ERPXinChou(); Model.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.txtXCName.Text=Model.XCName.ToString(); this.txtJianJie.Text=Model.JianJie.ToString(); this.txtUserName.Text=Model.UserName.ToString(); this.txtTimeStr.Text=Model.TimeStr.ToString(); DataBindToGridview(); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPXinChou Model = new ZWL.BLL.ERPXinChou(); Model.ID = int.Parse(Request.QueryString["ID"].ToString()); Model.XCName=this.txtXCName.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 ERPXinChouCanShu order by BackInfo"); //�����ݵ��б��� DataSet UserDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser order by UserName asc"); //�����һ�ε���ϸ��¼��Ȼ��������ӡ� ZWL.DBUtility.DbHelperSQL.ExecuteSQL("delete from ERPXCDetails where XCID=" + 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.ERPXCDetails MyModel = new ZWL.BLL.ERPXCDetails(); MyModel.XCID = 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.txtXCName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "н��������Ϣ�ijɹ���", "XinChou.aspx"); }