Ejemplo n.º 1
0
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="id"></param>
        protected void PageInit(string id)
        {
            BGovFilePersonnel BLL = new BGovFilePersonnel();
            //根据员工编号获取员工离职信息实体
            MGovFilePersonnel model = BLL.GetGovFilePersonnelModelByFileId(id);

            if (model != null)
            {
                //表单赋值、列表绑定
                this.lbFileName.Text        = model.FileName;
                this.lbApproveCause.Text    = model.Reason;
                this.lbApplicationTime.Text = string.Format("{0:yyyy-MM-dd}", model.ApplicationTime);
                if (model.GovPersonnelApproveList != null && model.GovPersonnelApproveList.Count > 0)
                {
                    this.rptapprove.DataSource = model.GovPersonnelApproveList;
                    this.rptapprove.DataBind();
                }
                if (model.ApproveState != ApprovalStatus.审核通过)
                {
                    ph_Save.Visible = false;
                }
                this.txtDepartureTime.Text = string.Format("{0:yyyy-MM-dd}", model.DepartureTime);
                if (!this.SiteUserInfo.IsHandleElse && this.SiteUserInfo.UserId != model.OperatorID)
                {
                    this.ph_Save.Visible = false;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 离职保存
        /// </summary>
        protected void PageSave()
        {
            string msg           = "";
            bool   result        = false;
            string id            = Utils.GetQueryStringValue("id");
            string departuretime = Utils.GetQueryStringValue("time");

            if (string.IsNullOrEmpty(departuretime))
            {
                msg += "-请输入员工离职时间!";
            }
            if (!string.IsNullOrEmpty(msg))
            {
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                Response.End();
            }
            BGovFilePersonnel BLL = new BGovFilePersonnel();

            result = BLL.UpdateIsLeft(Utils.GetDateTime(departuretime), id);
            msg    = result ? "保存成功!" : "保存失败!";
            Response.Clear();
            Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
            Response.End();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 删除操作
        /// </summary>
        /// <param name="id">删除ID</param>
        /// <returns></returns>
        private void DeleteData()
        {
            string id     = Utils.GetQueryStringValue("id");
            bool   result = false;
            string msg    = "";

            if (!String.IsNullOrEmpty(id))
            {
                BGovFilePersonnel BLL = new BGovFilePersonnel();
                result = BLL.DeleteGovFilePersonnel(id.Split(','));
                msg    = result ? "删除成功!" : "删除失败!";
            }
            Response.Clear();
            Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
            Response.End();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 审批
        /// </summary>
        protected void PageApprove()
        {
            string msg    = "";
            bool   result = false;
            //表单取值
            string id      = Utils.GetQueryStringValue("id");
            string appid   = Utils.GetQueryStringValue("appid");
            string appName = Utils.GetQueryStringValue("appname");
            string appTime = Utils.GetQueryStringValue("apptime");
            string appView = Utils.GetQueryStringValue("appview");

            //验证
            if (string.IsNullOrEmpty(appTime))
            {
                msg += "-请输入审批时间!<br/>";
            }
            if (string.IsNullOrEmpty(appView))
            {
                msg += "-请输入审批意见!<br/>";
            }
            if (!string.IsNullOrEmpty(msg))
            {
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                Response.End();
            }
            //实体赋值
            BGovFilePersonnel    BLL   = new BGovFilePersonnel();
            MGovPersonnelApprove model = new MGovPersonnelApprove();

            model.Id            = id;
            model.ApproveID     = appid;
            model.ApproveState  = ApprovalStatus.审核通过;
            model.ApproveTime   = Utils.GetDateTimeNullable(appTime);
            model.ApprovalViews = appView;
            model.ApproveName   = appName;
            //提交保存
            result = BLL.UpdateGovFilePersonnel(model);
            msg    = result ? "审批通过!" : "审批失败!";
            Response.Clear();
            Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
            Response.End();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string id)
        {
            BGovFilePersonnel BLL   = new BGovFilePersonnel();
            MGovFilePersonnel model = BLL.GetGovFilePersonnelModel(id);

            if (model != null)
            {
                this.hidKeyId.Value         = model.Id;
                this.HrSelect1.HrSelectName = model.FileName;
                this.HrSelect1.HrSelectID   = model.FileId;
                this.txtApplyCause.Text     = model.Reason;
                this.SellsSelect1.SellsID   = GetApproveList(model.GovPersonnelApproveList, 2);
                this.SellsSelect1.SellsName = GetApproveList(model.GovPersonnelApproveList, 1);
                this.txtWantTime.Text       = string.Format("{0:yyyy-MM-dd}", model.ApplicationTime);
                if (this.SiteUserInfo.UserId != model.OperatorID && !this.SiteUserInfo.IsHandleElse)
                {
                    this.ph_Save.Visible = false;
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected void PageSave(string doType)
        {
            #region 表单取值
            string KeyId                = Utils.GetFormValue(this.hidKeyId.UniqueID);
            string filename             = Utils.GetFormValue(this.HrSelect1.HrSelectNameClient);
            string fileid               = Utils.GetFormValue(this.HrSelect1.HrSelectIDClient);
            string reason               = Utils.GetFormValue(this.txtApplyCause.UniqueID);
            string applicationtime      = Utils.GetFormValue(this.txtWantTime.UniqueID);
            string personnelapprovename = Utils.GetFormValue(this.SellsSelect1.SellsNameClient);
            string personnerapproveid   = Utils.GetFormValue(this.SellsSelect1.SellsIDClient);
            #endregion

            #region 表单验证
            string msg    = "";
            bool   result = false;
            if (string.IsNullOrEmpty(filename) || string.IsNullOrEmpty(fileid))
            {
                msg += "-请选择申请人员!";
            }
            if (string.IsNullOrEmpty(personnelapprovename))
            {
                msg += "-请选择审批人员!";
            }
            if (!string.IsNullOrEmpty(msg))
            {
                Response.Clear();
                Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
                Response.End();
            }
            #endregion
            #region 实体赋值
            MGovFilePersonnel model = new MGovFilePersonnel();
            model.ApplicationTime         = Utils.GetDateTimeNullable(applicationtime);
            model.ApproveState            = ApprovalStatus.待审核;
            model.DepartureTime           = null;
            model.FileId                  = fileid;
            model.FileName                = filename;
            model.GovPersonnelApproveList = GetApproveList(personnerapproveid, personnelapprovename, KeyId);
            model.Id          = KeyId;
            model.IssueTime   = DateTime.Now;
            model.OperatorID  = this.SiteUserInfo.UserId;
            model.Reason      = reason;
            model.StaffStatus = StaffStatus.在职;
            #endregion
            #region 提交保存
            BGovFilePersonnel BLL = new BGovFilePersonnel();
            if (doType == "add")
            {
                result = BLL.AddGovFilePersonnel(model);
                msg    = result ? "添加成功!" : "添加失败";
            }
            if (doType == "update")
            {
                result = BLL.UpdateGovFilePersonnel(model);
                msg    = result ? "修改成功!" : "修改失败!";
            }
            Response.Clear();
            Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg));
            Response.End();
            #endregion
        }