Example #1
0
    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");
    }
Example #2
0
    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");
    }