Exemple #1
0
        /// <summary>
        /// �������������������
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public bool GetInBill(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())
            {
                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.InBillMaster(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 = "û���µ���ⵥ���أ�";
            }
            return tag;
        }
Exemple #2
0
        /// <summary>
        /// �������������������
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public bool GetInBill(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.MakeString(inMasterBillNo, "bill_no");
                    string billnolistStr = string.Format("ORDER_DATE >='{0}' AND ORDER_DATE <='{1}'", startDate, endDate);
                    DataTable masterdt = this.InBillMaster(billnolistStr);
                    DataRow[] masterdr = masterdt.Select("ORDER_ID NOT IN(" + billnolist + ")");

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

                    if (masterdr.Length > 0 && detaildt.Rows.Count > 0)
                    {
                        DataSet masterds = this.InBillMaster(masterdr, 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;
        }
Exemple #3
0
 /// <summary>
 /// ��ѯ���ֲִ�4������ⵥ
 /// </summary>
 /// <returns></returns>
 public DataTable GetInBillNo()
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownInBillDao dao = new DownInBillDao();
         return dao.GetBillNo();
     }
 }
Exemple #4
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);
         }
     }
 }
Exemple #5
0
 /// <summary>
 /// ������ⵥ�������� ����
 /// </summary>
 /// <returns></returns>
 public DataTable InBillMasters(string inBillNoList)
 {
     using (PersistentManager dbpm = new PersistentManager("YXConnection"))
     {
         DownInBillDao dao = new DownInBillDao();
         dao.SetPersistentManager(dbpm);
         return dao.GetInBillMasters(inBillNoList);
     }
 }