Ejemplo n.º 1
0
        public void UpdateLeaveApplication(tlvleaapp _leaveApp)
        {
            try
            {
                //分析请假并保存
                lvanalevBll bll = new lvanalevBll();

                List <ColumnInfo> dateParameters = new List <ColumnInfo>();
                dateParameters.Add(new ColumnInfo()
                {
                    ColumnName = "lvstart", ColumnValue = UtilDatetime.FormateDateTime1(_leaveApp.frtm)
                });
                dateParameters.Add(new ColumnInfo()
                {
                    ColumnName = "lvend", ColumnValue = UtilDatetime.FormateDateTime1(_leaveApp.totm), ColumnType = "datetime"
                });

                List <ColumnInfo> personParameters = new List <ColumnInfo>();
                personParameters.Add(new ColumnInfo()
                {
                    ColumnName = "emp.emno", ColumnValue = _leaveApp.emno
                });


                using (TransactionScope scope = new TransactionScope())
                {
                    //先删除leave detail
                    List <ColumnInfo> apnoParameters = new List <ColumnInfo>()
                    {
                        new ColumnInfo()
                        {
                            ColumnName = "apno", ColumnValue = _leaveApp.apno
                        }
                    };
                    dal.DeleteLeaveAppDtl(apnoParameters);

                    //如果审核过,则分析休假,并生成leave detail
                    if (_leaveApp.lvst == "Approved")
                    {
                        bll.AnalyzeLeave(dateParameters, personParameters, _leaveApp, true);
                    }

                    DoUpdate <tlvleaapp>(_leaveApp, apnoParameters);

                    scope.Complete();
                }
            }
            catch (UtilException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new UtilException(ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
 public LvSettingInfo GetEmpLeaveSettings(string _emno, string _ltcd, DateTime _leavedate)
 {
     try
     {
         lvanalevBll bll = new lvanalevBll();
         return(bll.GetEmpLeaveSettings(_emno, _ltcd, _leavedate));
     }
     catch (UtilException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw new UtilException(ex.Message, ex);
     }
 }
Ejemplo n.º 3
0
        public string CalcLeaveTime(tlvleaapp leaveApp)
        {
            try
            {
                //只分析请假
                lvanalevBll bll = new lvanalevBll();

                List <ColumnInfo> dateParameters = new List <ColumnInfo>();
                dateParameters.Add(new ColumnInfo()
                {
                    ColumnName = "lvstart", ColumnValue = UtilDatetime.FormateDateTime1(leaveApp.frtm)
                });
                dateParameters.Add(new ColumnInfo()
                {
                    ColumnName = "lvend", ColumnValue = UtilDatetime.FormateDateTime1(leaveApp.totm), ColumnType = "datetime"
                });

                List <ColumnInfo> personParameters = new List <ColumnInfo>();
                personParameters.Add(new ColumnInfo()
                {
                    ColumnName = "emp.emno", ColumnValue = leaveApp.emno
                });

                bll.AnalyzeLeave(dateParameters, personParameters, null, false);

                return("totallvhours:'" + bll.TotalLvHours.ToString() + "',totallvdays:'" + bll.TotalLvDays.ToString() + "'");
            }
            catch (UtilException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new UtilException(ex.Message, ex);
            }
        }