Ejemplo n.º 1
0
        /// <summary>
        /// 1.8.10    请假
        /// </summary>
        public InterfaceOutPut AskLeave(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 1;
            try
            {
                InAskLeave   InParams = JsonConvert.DeserializeObject <InAskLeave>(Data);
                DBLCAskLeave db       = new DBLCAskLeave();

                int nAL = 0;
                nAL = db.AskLeave(InParams.LeaveApply);

                if (nAL == 0)
                {
                    MD.TrainmanMin   tm   = new TrainmanMin();
                    MD.TrainmanJLMin tmJL = new TrainmanJLMin();
                    TF.RunSafty.NamePlate.PrepareTMOrder tmOrder = new NamePlate.PrepareTMOrder();
                    DBLinShi.GetTrainman(InParams.LeaveApply.strTrainmanGUID, tm);
                    DBLinShi.GetTrainmanJL(tm.TrainmanJLGUID, tmJL);
                    if (tmJL.TrainmanJLType == 3)
                    {
                        if (TF.RunSafty.NamePlate.LCPrepareTMOrder.IsTurnPrepare(tmJL.TrainmanJLGUID))
                        {
                            if (TF.RunSafty.NamePlate.LCPrepareTMOrder.GetTrainmanOrder(tm.TrainmanNumber, tmOrder))
                            {
                                TF.RunSafty.NamePlate.LCPrepareTMOrder.DeletePrepareTrainmanOrder(tmOrder);
                            }
                        }
                    }
                    output.result    = 0;
                    output.resultStr = "请假成功";
                }
                else if (nAL == 1)
                {
                    output.resultStr = "请假失败";
                }
                else if (nAL == 2)
                {
                    output.resultStr = "请假失败,该机组人员处于调休状态!";
                }

                //约定年休假类型名为"年休假"
                if (InParams.LeaveApply.strTypeName == "年休假")
                {
                    new DBAnnualLeave().ExecuteLeave(InParams.LeaveApply);
                }
            }
            catch (Exception ex)
            {
                output.resultStr = "请假失败:" + ex.Message;
                throw ex;
            }
            return(output);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 1.8.16    销假
        /// </summary>
        public InterfaceOutPut AddCancelLeaveDetail(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 1;
            try
            {
                InAddCancelLeaveDetail InParams = JsonConvert.DeserializeObject <InAddCancelLeaveDetail>(Data);
                DBLCAskLeave           db       = new DBLCAskLeave();
                db.CancelLeave(InParams.CancelLeaveDetail);
                MD.TrainmanMin   tm   = new TrainmanMin();
                MD.TrainmanJLMin tmJL = new TrainmanJLMin();
                TF.RunSafty.NamePlate.PrepareTMOrder tmOrder = new NamePlate.PrepareTMOrder();
                DBLinShi.GetTrainman(InParams.CancelLeaveDetail.strTrainmanID, tm);
                DBLinShi.GetTrainmanJL(tm.TrainmanJLGUID, tmJL);
                if (tmJL.TrainmanJLType == 3)
                {
                    if (TF.RunSafty.NamePlate.LCPrepareTMOrder.IsTurnPrepare(tmJL.TrainmanJLGUID))
                    {
                        int maxOrder = TF.RunSafty.NamePlate.LCPrepareTMOrder.GetMaxTMOrder(tmJL.TrainmanJLGUID, tm.PostID);
                        tmOrder.PostID = tm.PostID;

                        tmOrder.TrainmanJiaoluGUID = tmJL.TrainmanJLGUID;
                        tmOrder.TrainmanJiaoluName = tmJL.TrainmanJLName;
                        tmOrder.TrainmanName       = tm.TrainmanName;
                        tmOrder.TrainmanNumber     = tm.TrainmanNumber;
                        tmOrder.TrainmanOrder      = maxOrder + 1;

                        TF.RunSafty.NamePlate.LCPrepareTMOrder.AddPrepareTMOrder(tmOrder);
                    }
                }
                output.result    = 0;
                output.resultStr = "销假成功";
            }
            catch (Exception ex)
            {
                output.resultStr = "销假失败:" + ex.Message;
                throw ex;
            }
            return(output);
        }