Example #1
0
        /// <summary>
        /// 获取上游单据审核日期
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static string GetVerifyData(Model.Synergismlogdt dt)
        {
            string strDefault = DateTime.Now.ToString("yyyy-MM-dd").Replace('.', '-').Replace('/', '-');

            if (dt.Ilineno <= 1)
            {
                return(strDefault);
            }

            BLL.TaskLogFactory.ITaskLogDetail bllDT = new BLL.SynergisnLogDT();
            DAL.SynergismLogDt   dalDT = new SynergismLogDt();
            Model.Synergismlogdt dtPrev;
            dtPrev = bllDT.GetPrevious(dt, dt.OP);
            Model.ConnectInfo ConnectStr = dalDT.getConnectStr(dtPrev);

            return(DAL.Common.GetVerifyDate(ConnectStr, dtPrev));
        }
Example #2
0
        public override Model.DealResult MakeVouch(BaseData bd)
        {
            Model.DealResult dr   = new Model.DealResult();
            DbHelperSQLP     help = new DbHelperSQLP(bd.ConnectInfo.Constring);
            string           sql  = "select cvalue from accinformation  with(nolock)  where  cname = 'bSAcreat' and ISNULL(cValue,'')<>''";
            string           flag = help.GetSingle(sql).NullToString();

            if (flag.ToLower() != "true")
            {
                return(base.MakeVouch(bd));
            }

            Model.Synergismlogdt dt     = bd.Synergismlogdt;
            BLL.SynergisnLogDT   bll    = new BLL.SynergisnLogDT();
            Model.Synergismlogdt prnext = bll.GetPrevious(dt, null);
            if (prnext.Cvouchertype != "01" && prnext.Cvouchertype != "03")
            {
                return(base.MakeVouch(bd));                                                              //modified by liuxzha 支持退货单
            }
            string id   = string.Empty;
            int    time = 1;

            while (string.IsNullOrEmpty(id) && time < 5)
            {
                sql = "select id from rdrecord32   with(nolock) where cbuscode='" + prnext.Cvoucherno + "'";
                id  = help.GetSingle(sql).NullToString();
                System.Threading.Thread.Sleep(1000 * time);
                time++;
            }
            if (string.IsNullOrEmpty(id))
            {
                throw new Exception("未能取到U8系统自动生成的出库单!");
            }
            // DAL.Common.WriteWinLog(id);
            dr.VouchIdRet = id;
            return(dr);
        }