/// <summary>
        /// 删除离职记录
        /// </summary>
        /// <param name="leaveOffice"></param>
        /// <returns></returns>
        public bool DeleteLeaveOffices(LeaveOffice leaveOffice)
        {
            int isOk = 0;

            _leaveOfficeResposit.StatrAffair(() =>
            {
                isOk += _leaveOfficeResposit.UpdateInfo(x => new LeaveOffice {
                    IsDel = "1"
                }, x => x.Id == leaveOffice.Id);
                isOk += _processStepRecordResposit.UpdateInfo(x => new ProcessStepRecord {
                    Result = 0
                }, x => x.NoN == leaveOffice.NoN);
            });
            return(isOk > 0);
        }
Пример #2
0
        /// <summary>
        /// 审批确定油料申请数据
        /// </summary>
        /// <returns></returns>
        public string UpdateyouliaoInfo(string remack, int oilmId, int jobId)
        {
            string rutes = string.Empty;

            _processStepRecordResposit.StatrAffair(() =>
            {
                ProcessStepRecord processStepRecord           = new ProcessStepRecord();
                ProcessStepRecord processStep                 = _processStepRecordResposit.FindAll().FirstOrDefault(x => x.RefOrderId == oilmId);
                OilMaterialOrder oilMaterialOrder             = _oilMaterialOrderResposit.FindAll().FirstOrDefault(x => x.Id == oilmId);
                oilMaterialOrder.UpdateTime                   = DateTime.Now;
                OilMaterialOrderDetail oilMaterialOrderDetail = _oilMaterialOrderDetailResposit.FindAll().FirstOrDefault(x => x.OrderId == oilmId);
                oilMaterialOrderDetail.UpdateTime             = DateTime.Now;
                if ((int)JobEmun.油站经理 == jobId)
                {
                    if (remack == "同意")
                    {
                        processStep.OilStation       = 0;
                        processStep.OilStationRemark = remack;
                        processStep.Result           = 2;
                    }
                    else
                    {
                        processStep.OilStation       = 2; //不同意该申请
                        processStep.OilStationRemark = remack;
                        processStep.Result           = 3;
                    }
                }
                else if ((int)JobEmun.主管 == jobId)
                {
                    if (remack == "同意")
                    {
                        processStep.GeneralManagerOfPerson       = 0;
                        processStep.GeneralManagerOfPersonRemark = remack;
                        processStep.Result = 2;
                    }
                    else
                    {
                        processStep.GeneralManagerOfPerson       = 2; //不同意该申请
                        processStep.GeneralManagerOfPersonRemark = remack;
                        processStep.Result = 3;
                    }
                }
                else if ((int)JobEmun.总经理 == jobId)
                {
                    if (remack == "同意")
                    {
                        processStep.GeneralManager       = 0;
                        processStep.GeneralManagerRemark = remack;
                        processStep.Result = 2;
                    }
                    else
                    {
                        processStep.GeneralManager       = 2; //不同意该申请
                        processStep.GeneralManagerRemark = remack;
                        processStep.Result = 3;
                    }
                }
                else if ((int)JobEmun.总监 == jobId)
                {
                    if (remack == "同意")
                    {
                        processStep.ChiefInspector       = 0;
                        processStep.ChiefInspectorRemark = remack;
                        processStep.Result = 2;
                    }
                    else
                    {
                        processStep.ChiefInspector       = 2; //不同意该申请
                        processStep.ChiefInspectorRemark = remack;
                        processStep.Result = 3;
                    }
                }
                _processStepRecordResposit.UpdateInfo((x) => new ProcessStepRecord
                {
                    OilStation                   = processStep.OilStation,
                    OilStationRemark             = processStep.OilStationRemark,
                    GeneralManagerOfPersonRemark = processStep.GeneralManagerOfPersonRemark,
                    GeneralManagerOfPerson       = processStep.GeneralManagerOfPerson,
                    GeneralManager               = processStep.GeneralManager,
                    GeneralManagerRemark         = processStep.GeneralManagerRemark,
                    ChiefInspector               = processStep.ChiefInspector,
                    ChiefInspectorRemark         = processStep.ChiefInspectorRemark,
                    Result = processStep.Result
                }, x => x.Id == processStep.Id);

                _oilMaterialOrderDetailResposit.UpdateInfo((x) => new OilMaterialOrderDetail
                {
                    UpdateTime = oilMaterialOrderDetail.UpdateTime
                }, x => x.Id == oilMaterialOrderDetail.Id);

                _oilMaterialOrderResposit.UpdateInfo((x) => new OilMaterialOrder
                {
                    UpdateTime = oilMaterialOrder.UpdateTime
                }, x => x.Id == oilMaterialOrderDetail.Id);

                rutes = "ok";
            });
            return(rutes);
        }