Beispiel #1
0
        /// <summary>
        /// 获取附属详细信息,包括审核状态和审核备注
        /// </summary>
        /// <param name="id">ID</param>
        /// <returns>异常返回null</returns>

        public BTApply GetPreBusinessTripDetail(string id)
        {
            V_HR_BTWithDepName bt;

            PreID = id;
            using (Entities db = new Entities())
            {
                bt = db.V_HR_BTWithDepName.Find(id);
                T_CH_Operation_list op = db.T_CH_Operation_list.Find(GetPreOperationListID);
                var task = from o in db.V_CH_TaskOperation
                           where o.OperationID == GetPreOperationListID
                           select o;

                if (bt != null && task.Any())
                {
                    PreID              = bt.ID;
                    PreStaffID         = bt.StaffID;
                    PreName            = bt.Name;
                    PreDepartment      = bt.Department;
                    PreBTPlace         = bt.BTPlace;
                    PreStartTime       = Convert.ToDateTime(bt.StartTime);
                    PreEndTime         = Convert.ToDateTime(bt.EndTime);
                    PreStartTimeStr    = PreStartTime.ToString("yyyy-MM-dd HH:mm");
                    PreEndTimeStr      = PreEndTime.ToString("yyyy-MM-dd HH:mm");
                    PreTimeSpan        = bt.TimeSpan;
                    PreBTReason        = bt.BTReason;
                    PreValid           = Convert.ToBoolean(bt.Valid);
                    PreRemark          = bt.Remark;
                    PreCreaterName     = bt.CreaterName;
                    PreCreateTime      = Convert.ToDateTime(bt.CreateTime);
                    PreEditorName      = bt.EditorName;
                    PreEditeTime       = Convert.ToDateTime(bt.EditeTime);
                    PreOperationListID = bt.OperationListID;
                    PreLastID          = bt.LastID;
                    PreBTEdit          = Convert.ToBoolean(bt.BTEdit);
                    PreBTDelete        = Convert.ToBoolean(bt.BTDelete);
                    PreEditOrDelete    = bt.EditOrDelete;

                    PreState = op.State;
                    PreDescriptionForCheck = "";
                    foreach (V_CH_TaskOperation items in task)
                    {
                        PreDescriptionForCheck += items.Description;
                    }
                    PreCheckFlowId = op.Check_flowID;
                }
                else
                {
                    return(null);
                }
                return(this);
            }
        }
        /// <summary>
        /// 获取附属离职详细信息,包括审核状态和审核备注
        /// </summary>
        /// <param name="id">离职ID</param>
        /// <returns>异常返回null</returns>

        public VacationApply GetPreVacationDetail(string id)
        {
            V_HR_VacationWithDepName va;

            PreID = id;
            using (Entities db = new Entities())
            {
                va = db.V_HR_VacationWithDepName.Find(id);
                T_CH_Operation_list op = db.T_CH_Operation_list.Find(GetPreOperationListID);
                var task = from o in db.V_CH_TaskOperation
                           where o.OperationID == GetPreOperationListID
                           select o;

                if (va != null && task.Any())
                {
                    PreID              = va.ID;
                    PreStaffID         = va.StaffID;
                    PreName            = va.Name;
                    PreDepartment      = va.Department;
                    PreVPType          = va.VPType;
                    PreStartTime       = Convert.ToDateTime(va.StartTime);
                    PreEndTime         = Convert.ToDateTime(va.EndTime);
                    PreStartTimeStr    = PreStartTime.ToString("yyyy-MM-dd HH:mm");
                    PreEndTimeStr      = PreEndTime.ToString("yyyy-MM-dd HH:mm");
                    PreTimeSpan        = Convert.ToDecimal(va.TimeSpan);
                    PreVPReason        = va.VPReason;
                    PreValid           = Convert.ToBoolean(va.Valid);
                    PreRemark          = va.Remark;
                    PreCreaterName     = va.CreaterName;
                    PreCreateTime      = Convert.ToDateTime(va.CreateTime);
                    PreEditorName      = va.EditorName;
                    PreEditeTime       = Convert.ToDateTime(va.EditeTime);
                    PreOperationListID = va.OperationListID;
                    PreLastID          = va.LastID;
                    PreVPEdit          = Convert.ToBoolean(va.VPEdit);
                    PreVPDelete        = Convert.ToBoolean(va.VPDelete);
                    PreEditOrDelete    = va.EditOrDelete;

                    PreState = op.State;
                    PreDescriptionForCheck = "";
                    foreach (V_CH_TaskOperation items in task)
                    {
                        PreDescriptionForCheck += items.Description;
                    }
                    PreCheckFlowId = op.Check_flowID;
                }
                else
                {
                    return(null);
                }
                return(this);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 获取审核对象
        /// </summary>
        /// <param name="id">V_HR_BTWithDepName的ID</param>
        /// <returns>异常返回null</returns>

        public BTApply GetCheckPreBusinessTrip(string id)
        {
            V_HR_BTWithDepName bt;
            //V_CH_TaskOperation task;
            LoginUser user = new LoginUser();

            PreID = id;
            using (Entities db = new Entities())
            {
                bt = db.V_HR_BTWithDepName.Find(id);
                var task = from o in db.V_CH_TaskOperation
                           where o.OperationID == GetPreOperationListID && o.StaffID == user.EmployeeId && o.Expire == false
                           select o;
                //task = db.V_CH_TaskOperation.Where(l => l.OperationID == GetOperationListID && l.StaffID == user.EmployeeID && l.Expire == false).ToList().FirstOrDefault();

                if (bt != null && task.Any())
                {
                    PreID              = bt.ID;
                    PreStaffID         = bt.StaffID;
                    PreName            = bt.Name;
                    PreDepartment      = bt.Department;
                    PreBTPlace         = bt.BTPlace;
                    PreStartTime       = Convert.ToDateTime(bt.StartTime);
                    PreEndTime         = Convert.ToDateTime(bt.EndTime);
                    PreStartTimeStr    = PreStartTime.ToString("yyyy-MM-dd HH:mm");
                    PreEndTimeStr      = PreEndTime.ToString("yyyy-MM-dd HH:mm");
                    PreTimeSpan        = bt.TimeSpan;
                    PreBTReason        = bt.BTReason;
                    PreValid           = Convert.ToBoolean(bt.Valid);
                    PreRemark          = bt.Remark;
                    PreCreaterName     = bt.CreaterName;
                    PreCreateTime      = Convert.ToDateTime(bt.CreateTime);
                    PreEditorName      = bt.EditorName;
                    PreEditeTime       = Convert.ToDateTime(bt.EditeTime);
                    PreOperationListID = bt.OperationListID;
                    PreLastID          = bt.LastID;
                    PreBTEdit          = Convert.ToBoolean(bt.BTEdit);
                    PreBTDelete        = Convert.ToBoolean(bt.BTDelete);
                    PreEditOrDelete    = bt.EditOrDelete;

                    State = task.First().State;
                    DescriptionForCheck = task.First().Description;
                    CheckFlowId         = task.First().Check_flowID;
                }
                else
                {
                    return(null);
                }
                return(this);
            }
        }
        /// <summary>
        /// 获取审核对象
        /// </summary>
        /// <param name="id">V_HR_VacationWithDepName的ID</param>
        /// <returns>异常返回null</returns>

        public VacationApply GetCheckPreVacation(string id)
        {
            V_HR_VacationWithDepName va;
            //V_CH_TaskOperation task;
            LoginUser user = new LoginUser();

            PreID = id;
            using (Entities db = new Entities())
            {
                va = db.V_HR_VacationWithDepName.Find(id);
                var task = from o in db.V_CH_TaskOperation
                           where o.OperationID == GetPreOperationListID && o.StaffID == user.EmployeeId && o.Expire == false
                           select o;
                //task = db.V_CH_TaskOperation.Where(l => l.OperationID == GetOperationListID && l.StaffID == user.EmployeeID && l.Expire == false).ToList().FirstOrDefault();

                if (va != null && task.Any())
                {
                    PreID              = va.ID;
                    PreStaffID         = va.StaffID;
                    PreName            = va.Name;
                    PreDepartment      = va.Department;
                    PreVPType          = va.VPType;
                    PreStartTime       = Convert.ToDateTime(va.StartTime);
                    PreEndTime         = Convert.ToDateTime(va.EndTime);
                    PreStartTimeStr    = PreStartTime.ToString("yyyy-MM-dd HH:mm");
                    PreEndTimeStr      = PreEndTime.ToString("yyyy-MM-dd HH:mm");
                    PreTimeSpan        = Convert.ToDecimal(va.TimeSpan);
                    PreVPReason        = va.VPReason;
                    PreValid           = Convert.ToBoolean(va.Valid);
                    PreRemark          = va.Remark;
                    PreCreaterName     = va.CreaterName;
                    PreCreateTime      = Convert.ToDateTime(va.CreateTime);
                    PreEditorName      = va.EditorName;
                    PreEditeTime       = Convert.ToDateTime(va.EditeTime);
                    PreOperationListID = va.OperationListID;
                    PreLastID          = va.LastID;
                    PreVPEdit          = Convert.ToBoolean(va.VPEdit);
                    PreVPDelete        = Convert.ToBoolean(va.VPDelete);
                    PreEditOrDelete    = va.EditOrDelete;

                    State = task.First().State;
                    DescriptionForCheck = task.First().Description;
                    CheckFlowId         = task.First().Check_flowID;
                }
                else
                {
                    return(null);
                }
                return(this);
            }
        }