Exemplo n.º 1
0
        public void SaveOTDetail(totdetail obj)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    //如果自动转换成休假,则新增lvdfbyemp
                    double hoursToTTLV = 0;
                    int    lvdefseq    = 0;

                    List <ColumnInfo> ottypeParameters = new List <ColumnInfo>()
                    {
                        new ColumnInfo()
                        {
                            ColumnName = "otcd", ColumnValue = obj.otcd
                        }
                    };

                    tottype otType = GetSelectedObject <tottype>(ottypeParameters);

                    if (otType.autr == "Y")
                    {
                        otttlvBll ttlvBll = new otttlvBll();
                        hoursToTTLV = ttlvBll.TransferToLeave(obj, otType, ref lvdefseq);
                    }

                    //更新detail的ttlv信息
                    obj.istr = hoursToTTLV == 0 ? "N" : "Y";
                    obj.ttlv = hoursToTTLV == 0 ? "" : obj.tottype.otcd;
                    obj.tlhr = hoursToTTLV;
                    obj.tlrf = lvdefseq.ToString();
                    obj.lmur = Function.GetCurrentUser();
                    obj.lmtm = DateTime.Now;

                    baseDal.DoInsert <totdetail>(obj);

                    scope.Complete();
                }
            }
            catch (UtilException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new UtilException(ex.Message, ex);
            }
            finally
            {
            }
        }