Beispiel #1
0
        public bool DownInBillInfoAuto(string EmployeeCode)
        {
            bool tag = true;

            Employee = EmployeeCode;
            using (PersistentManager dbpm = new PersistentManager("YXConnection"))
            {
                DownInBillDao dao = new DownInBillDao();
                dao.SetPersistentManager(dbpm);

                DataTable WmsInBillTable = this.GetInBillNo();
                string    inBillNoList   = UtinString.StringMake(WmsInBillTable, "BILLNO");
                inBillNoList = UtinString.StringMake(inBillNoList);
                inBillNoList = "ORDER_ID NOT IN(" + inBillNoList + ")";
                DataTable masterdt = this.InBillMaster(inBillNoList);
                DataTable detaildt = this.InBillDetail(inBillNoList);

                DataRow[] masterdr = masterdt.Select("1=1");
                DataRow[] detaildr = detaildt.Select("1=1");

                if (masterdr.Length > 0 && detaildr.Length > 0)
                {
                    DataSet detailds = this.InBillDetail(detaildr);
                    DataSet masterds = this.InBillMaster(masterdr);
                    this.Insert(masterds, detailds);
                }
                else
                {
                    tag = false;
                }
            }
            return(tag);
        }
Beispiel #2
0
        /// <summary>
        /// 根据日期下载入库数据
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public bool GetInBill(string startDate, string endDate, string EmployeeCode)
        {
            bool tag = true;

            Employee = EmployeeCode;
            using (PersistentManager pm = new PersistentManager())
            {
                DownInBillDao dao = new DownInBillDao();
                dao.SetPersistentManager(pm);
                DataTable inMasterBillNo = this.GetInBillNo();
                string    billnolist     = UtinString.StringMake(inMasterBillNo, "BILLNO");
                billnolist = UtinString.StringMake(billnolist);
                billnolist = string.Format("ORDER_DATE >='{0}' AND ORDER_DATE <='{1}' AND ORDER_ID NOT IN({2})", startDate, endDate, billnolist);
                DataTable masterdt = this.InBillMaster(billnolist);

                string inDetailList = UtinString.StringMake(masterdt, "ORDER_ID");
                inDetailList = UtinString.StringMake(inDetailList);
                inDetailList = "ORDER_ID IN(" + inDetailList + ")";
                DataTable detaildt = this.InBillDetail(inDetailList);

                DataRow[] masterdr = masterdt.Select("1=1");
                DataRow[] detaildr = detaildt.Select("1=1");
                if (masterdr.Length > 0 && detaildr.Length > 0)
                {
                    DataSet detailds = this.InBillDetail(detaildr);
                    DataSet masterds = this.InBillMaster(masterdr);
                    this.Insert(masterds, detailds);
                }
                else
                {
                    tag = false;
                }
            }
            return(tag);
        }
Beispiel #3
0
 /// <summary>
 /// 查询数字仓储4天内入库单
 /// </summary>
 /// <returns></returns>
 public DataTable GetInBillNo()
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         return(dao.GetBillNo());
     }
 }
Beispiel #4
0
 /// <summary>
 /// 下载入库单明细表数据
 /// </summary>
 /// <returns></returns>
 public DataTable InBillDetail(string inBillNoList)
 {
     using (PersistentManager dbpm = new PersistentManager("YXConnection"))
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(dbpm);
         return(dao.GetInBillDetail(inBillNoList));
     }
 }
Beispiel #5
0
 public string SelectIdList(string billNo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         return(dao.SelectIdList(billNo));
     }
 }
Beispiel #6
0
 public void DeleteDownReturnInBillInfo(string billNo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         dao.Delete(billNo);
     }
 }
Beispiel #7
0
 public void UpdateReturnInBillState(string idList, string state)
 {
     using (PersistentManager pm = new PersistentManager("ServerConnection"))
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         dao.UpdateReturnInBilLState(idList, state);
     }
 }
Beispiel #8
0
 public void InsertReturnInBillDetail(DataSet ds)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         dao.InsertInBillDetail(ds);
     }
 }
Beispiel #9
0
 public DataTable ReturnInBillInfo()
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         return(dao.ReturnInBill());
     }
 }
Beispiel #10
0
 public void InsertReturnInBill(string idList, string billNo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         dao.Insert(billNo, idList);
     }
 }
Beispiel #11
0
 public void InsertReturnInBillMaster(string billNo, string memo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         dao.InsertReturnInBillMaster(billNo, memo);
     }
 }
Beispiel #12
0
 public int ReturnInBillCount()
 {
     using (PersistentManager pm = new PersistentManager("ServerConnection"))
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(pm);
         return(dao.ReturnInBillCount());
     }
 }
Beispiel #13
0
 /// <summary>
 /// 分页查询营销系统数据入库单据明细表
 /// </summary>
 /// <param name="PrimaryKey"></param>
 /// <param name="papeIndex"></param>
 /// <param name="papeSize"></param>
 /// <param name="orderBy"></param>
 /// <param name="inBillNo"></param>
 /// <returns></returns>
 public DataTable GetInBillDetail(string PrimaryKey, int papeIndex, int papeSize, string orderBy, string inBillNo)
 {
     using (PersistentManager dbpm = new PersistentManager("YXConnection"))
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(dbpm);
         return(dao.GetInBillDetailByBillNo(inBillNo));
     }
 }
Beispiel #14
0
 /// <summary>
 /// 把查询的数据添加到仓储数据库
 /// </summary>
 /// <param name="masterds"></param>
 /// <param name="detailds"></param>
 public void Insert(DataSet masterds, DataSet detailds)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         if (masterds.Tables["WMS_IN_BILLMASTER"].Rows.Count > 0)
         {
             dao.InsertInBillMaster(masterds);
         }
         if (detailds.Tables["WMS_IN_BILLDETAIL"].Rows.Count > 0)
         {
             dao.InsertInBillDetail(detailds);
         }
     }
 }
Beispiel #15
0
 /// <summary>
 /// 分页查询营销系统数据入库单据主表
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <returns></returns>
 public DataTable GetInBillMaster(int pageIndex, int pageSize)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         using (PersistentManager dbpm = new PersistentManager("YXConnection"))
         {
             DownInBillDao masterdao = new DownInBillDao();
             masterdao.SetPersistentManager(pm);
             DownInBillDao dao = new DownInBillDao();
             dao.SetPersistentManager(dbpm);
             DataTable billnodt   = masterdao.GetBillNo();
             string    billnolist = UtinString.StringMake(billnodt, "BILLNO");
             billnolist = UtinString.StringMake(billnolist);
             return(dao.GetInBillMasterByBillNo(billnolist));
         }
     }
 }
Beispiel #16
0
        /// <summary>
        /// 下载入库主表 创联
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="EmployeeCode"></param>
        /// <param name="wareCode"></param>
        /// <param name="billtype"></param>
        /// <param name="errorInfo"></param>
        /// <returns></returns>
        public bool GetInBills(string startDate, string endDate, string EmployeeCode, string wareCode, string billtype, out string errorInfo)
        {
            bool tag = false;

            Employee  = EmployeeCode;
            errorInfo = string.Empty;
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    DownInBillDao dao            = new DownInBillDao();
                    DataTable     emply          = dao.FindEmployee(EmployeeCode);
                    DataTable     inMasterBillNo = this.GetInBillNo();
                    string        billnolist     = UtinString.StringMake(inMasterBillNo, "bill_no");
                    billnolist = UtinString.StringMake(billnolist);
                    billnolist = string.Format("ORDER_DATE >='{0}' AND ORDER_DATE <='{1}' AND ORDER_ID NOT IN({2})", startDate, endDate, billnolist);
                    DataTable masterdt = this.InBillMasters(billnolist);

                    string inDetailList = UtinString.StringMake(masterdt, "ORDER_ID");
                    inDetailList = UtinString.StringMake(inDetailList);
                    inDetailList = "ORDER_ID IN(" + inDetailList + ")";
                    DataTable detaildt = this.InBillDetail(inDetailList);

                    if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0)
                    {
                        DataSet masterds = this.InBillMaster(masterdt, emply.Rows[0]["employee_id"].ToString(), wareCode, billtype);

                        DataSet detailds = this.InBillDetail(detaildt);
                        this.Insert(masterds, detailds);
                        tag = true;
                    }
                    else
                    {
                        errorInfo = "没有新的入库单下载!";
                    }
                }
                catch (Exception e)
                {
                    errorInfo = "下载入库单失败!原因:" + e.Message;
                }
            }
            return(tag);
        }