示例#1
0
 protected void GVConfirm_DataBound(object sender, System.EventArgs e)
 {
     for (int i = 0; i < this.GVConfirm.Rows.Count; i++)
     {
         if (this.GVConfirm.Rows[i].Cells[6].Text.Trim() != "已销假" && this.GVConfirm.Rows[i].Cells[3].Text != "")
         {
             System.DateTime t = System.DateTime.Parse(this.GVConfirm.Rows[i].Cells[3].Text);
             if (this.GVConfirm.DataKeys[i].Values["Days"].ToString() != "" && this.GVConfirm.DataKeys[i].Values["Days"].ToString() != null)
             {
                 t.AddDays(System.Math.Ceiling(System.Convert.ToDouble(this.GVConfirm.DataKeys[i].Values["Days"].ToString())));
             }
             System.DateTime t2 = System.Convert.ToDateTime(System.DateTime.Now.ToShortDateString());
             if (t < t2)
             {
                 HRLeaveApplication hRLeaveApplication = new HRLeaveApplication();
                 hRLeaveApplication.RecordID  = (System.Guid) this.GVConfirm.DataKeys[i].Values["RecordID"];
                 hRLeaveApplication.IsConfirm = "1";
                 hRLeaveApplication.LeaveDays = System.Convert.ToDecimal(this.GVConfirm.DataKeys[i].Values["Days"].ToString());
                 userManageDb userManageDb = new userManageDb();
                 hRLeaveApplication.ConfirmUser = userManageDb.GetUserName(this.Session["yhdm"].ToString());
                 this.AA.AnnulConfirmUpdate(hRLeaveApplication);
             }
         }
     }
 }
示例#2
0
    protected void GetPageData()
    {
        HRLeaveApplication model = this.aa.GetModel(this.rid);

        this.DDLLeaveType.SelectedValue = model.LeaveType.ToString();
        this.DBBeginDate.Text           = model.BeginDate.ToString("yyyy-MM-dd");
        this.txtDays.Text   = model.Days.ToString();
        this.txtReason.Text = model.Reason.ToString();
    }
示例#3
0
        public HRLeaveApplication GetModel(Guid RecordID)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select   ");
            builder.Append(" RecordID,AuditState,UserCode,RecordDate,LeaveType,BeginDate,Days,Reason,IsApply,BackDate,LeaveDays,ConfirmUser,IsConfirm ");
            builder.Append(" from HR_Leave_Application ");
            builder.Append(" where RecordID='" + RecordID + "' ");
            HRLeaveApplication application = new HRLeaveApplication();
            DataSet            set         = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            if (set.Tables[0].Rows[0]["RecordID"].ToString() != "")
            {
                application.RecordID = new Guid(set.Tables[0].Rows[0]["RecordID"].ToString());
            }
            if (set.Tables[0].Rows[0]["AuditState"].ToString() != "")
            {
                application.AuditState = int.Parse(set.Tables[0].Rows[0]["AuditState"].ToString());
            }
            application.UserCode = set.Tables[0].Rows[0]["UserCode"].ToString();
            if (set.Tables[0].Rows[0]["RecordDate"].ToString() != "")
            {
                application.RecordDate = DateTime.Parse(set.Tables[0].Rows[0]["RecordDate"].ToString());
            }
            if (set.Tables[0].Rows[0]["LeaveType"].ToString() != "")
            {
                application.LeaveType = int.Parse(set.Tables[0].Rows[0]["LeaveType"].ToString());
            }
            if (set.Tables[0].Rows[0]["BeginDate"].ToString() != "")
            {
                application.BeginDate = DateTime.Parse(set.Tables[0].Rows[0]["BeginDate"].ToString());
            }
            if (set.Tables[0].Rows[0]["Days"].ToString() != "")
            {
                application.Days = decimal.Parse(set.Tables[0].Rows[0]["Days"].ToString());
            }
            application.Reason  = set.Tables[0].Rows[0]["Reason"].ToString();
            application.IsApply = set.Tables[0].Rows[0]["IsApply"].ToString();
            if (set.Tables[0].Rows[0]["BackDate"].ToString() != "")
            {
                application.BackDate = DateTime.Parse(set.Tables[0].Rows[0]["BackDate"].ToString());
            }
            if (set.Tables[0].Rows[0]["LeaveDays"].ToString() != "")
            {
                application.LeaveDays = decimal.Parse(set.Tables[0].Rows[0]["LeaveDays"].ToString());
            }
            application.ConfirmUser = set.Tables[0].Rows[0]["ConfirmUser"].ToString();
            application.IsConfirm   = set.Tables[0].Rows[0]["IsConfirm"].ToString();
            return(application);
        }
示例#4
0
    protected HRLeaveApplication getHRLeaveApplication()
    {
        HRLeaveApplication hRLeaveApplication = new HRLeaveApplication();

        hRLeaveApplication.RecordID  = this.rid;
        hRLeaveApplication.IsConfirm = "1";
        hRLeaveApplication.LeaveDays = Convert.ToDecimal(this.txtLeaveDays.Text);
        userManageDb userManageDb = new userManageDb();

        hRLeaveApplication.ConfirmUser = userManageDb.GetUserName(this.Session["yhdm"].ToString());
        return(hRLeaveApplication);
    }
示例#5
0
        public int ConfirmUpdate(HRLeaveApplication model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update HR_Leave_Application set ");
            builder.Append("IsApply='" + model.IsApply + "',");
            builder.Append("BackDate='" + model.BackDate + "',");
            builder.Append("LeaveDays=" + model.LeaveDays + ",");
            builder.Append("IsConfirm='" + model.IsConfirm + "'");
            builder.Append(" where RecordID='" + model.RecordID + "' ");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
示例#6
0
        public int AnnulConfirmUpdate(HRLeaveApplication model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update HR_Leave_Application set ");
            builder.Append("LeaveDays=" + model.LeaveDays + ",");
            builder.Append("ConfirmUser='******',");
            builder.Append("backdate='" + DateTime.Now + "',");
            builder.Append("IsConfirm='" + model.IsConfirm + "'");
            builder.Append(" where RecordID='" + model.RecordID + "' ");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!base.IsPostBack)
        {
            HRLeaveApplication model = this.action.GetModel(this.id);
            if (model != null)
            {
                this.lblBllProducer.Text = PageHelper.QueryUser(this, base.UserCode);
                this.lblPrintDate.Text   = DateTime.Now.ToString("yyyy-MM-dd");
                this.LbBeginDate.Text    = model.BeginDate.ToString("yyyy-MM-dd");
                this.LbDays.Text         = model.Days.ToString();
                this.LbReason.Text       = model.Reason.ToString();
                this.LbBackDate.Text     = model.BackDate.ToString("yyyy-MM-dd HH:mm:ss");
                this.LbLeaveDays.Text    = model.LeaveDays.ToString();
                string key;
                switch (key = model.LeaveType.ToString())
                {
                case "1":
                    this.LbLeaveType.Text = "事假";
                    break;

                case "2":
                    this.LbLeaveType.Text = "婚假";
                    break;

                case "3":
                    this.LbLeaveType.Text = "年休假";
                    break;

                case "4":
                    this.LbLeaveType.Text = "工伤";
                    break;

                case "5":
                    this.LbLeaveType.Text = "病假";
                    break;

                case "6":
                    this.LbLeaveType.Text = "产假";
                    break;

                case "7":
                    this.LbLeaveType.Text = "丧假";
                    break;
                }
                userManageDb userManageDb = new userManageDb();
                this.LbUserName.Text = userManageDb.GetUserName(model.UserCode);
            }
        }
    }
示例#8
0
        public int Update(HRLeaveApplication model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update HR_Leave_Application set ");
            builder.Append("UserCode='" + model.UserCode + "',");
            builder.Append("LeaveType=" + model.LeaveType + ",");
            builder.Append("BeginDate='" + model.BeginDate + "',");
            builder.Append("Days=" + model.Days + ",");
            builder.Append("Reason='" + model.Reason + "',");
            builder.Append("IsApply='" + model.IsApply + "'");
            builder.Append(" where RecordID='" + model.RecordID + "' ");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
示例#9
0
    protected void GetPageData()
    {
        HRLeaveApplication model = this.aa.GetModel(this.rid);

        if (model != null)
        {
            this.LbBeginDate.Text = model.BeginDate.ToString("yyyy-MM-dd");
            this.LbDays.Text      = model.Days.ToString();
            this.LbReason.Text    = model.Reason.ToString();
            this.LbBackDate.Text  = model.BackDate.ToString();
            this.LbLeaveDays.Text = model.LeaveDays.ToString();
            string key;
            switch (key = model.LeaveType.ToString())
            {
            case "1":
                this.LbLeaveType.Text = "事假";
                break;

            case "2":
                this.LbLeaveType.Text = "婚假";
                break;

            case "3":
                this.LbLeaveType.Text = "年休假";
                break;

            case "4":
                this.LbLeaveType.Text = "工伤";
                break;

            case "5":
                this.LbLeaveType.Text = "病假";
                break;

            case "6":
                this.LbLeaveType.Text = "产假";
                break;

            case "7":
                this.LbLeaveType.Text = "丧假";
                break;
            }
            userManageDb userManageDb = new userManageDb();
            this.LbUserName.Text = userManageDb.GetUserName(model.UserCode);
        }
    }
示例#10
0
        public int Add(HRLeaveApplication model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into HR_Leave_Application(");
            builder.Append("RecordID,AuditState,UserCode,RecordDate,LeaveType,BeginDate,Days,Reason,IsApply");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append("'" + model.RecordID + "',");
            builder.Append(model.AuditState + ",");
            builder.Append("'" + model.UserCode + "',");
            builder.Append("'" + model.RecordDate + "',");
            builder.Append(model.LeaveType + ",");
            builder.Append("'" + model.BeginDate + "',");
            builder.Append(model.Days + ",");
            builder.Append("'" + model.Reason + "',");
            builder.Append("'" + model.IsApply + "'");
            builder.Append(")");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }