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;
        }