Exemple #1
0
        public static DataSet GetPurchase(dhDBnames dhDBnames, dhPurchase objPurchase)
        {
            DataSet var_ret;

            if (objblPurchase == null)
            {
                objblPurchase = new blPurchase();
            }
            {
                var_ret = objblPurchase.GetPurchase(dhDBnames, objPurchase);
            }
            return(var_ret);
        }
Exemple #2
0
        public DataSet GetPurchase(dhDBnames dhDBnames, dhPurchase objPurchase)
        {
            DataSet dsreturn = objDatabase.GetDataSet(dhDBnames, objPurchase, "xmlGetPurchase");

            if ((dsreturn.Tables.Count > 0) && (dsreturn.Tables.Count == 1))
            {
                dsreturn.Tables[0].TableName = "dtPosPurchase";
            }
            else if ((dsreturn.Tables.Count > 0) && (dsreturn.Tables.Count == 2))
            {
                dsreturn.Tables[0].TableName = "dtPosPurchase";
                dsreturn.Tables[1].TableName = "dtPosPurchaseItem";
            }
            return(dsreturn);
        }
Exemple #3
0
        public static DataSet InsertUpdatePurchase(dhDBnames dhDBnames, dhPurchase objPurchase, Boolean InsertItems = false)
        {
            try
            {
                DataSet var_ret;

                if (objblPurchase == null)
                {
                    objblPurchase = new blPurchase();
                }
                var_ret = objblPurchase.InsertUpdatePurchase(dhDBnames, objPurchase);
                if (InsertItems)
                {
                    // get the SaleID
                    Int64?ID = Convert.ToInt64(var_ret.Tables[0].Rows[0]["iPurchaseid"].ToString());;
                    // get the observerable collection
                    ItemsList ItemCollection = objPurchase.ItemsOfPurchase;
                    int       ItemID         = 1;
                    foreach (dhSaleItem item in ItemCollection)
                    {
                        item.IProductionId = ID;
                        item.IUpdate       = 0;
                        // item.ISerialNumber = ItemID;
                        ItemID       = ItemID + 1;
                        item.IUserId = Convert.ToInt32(objPurchase.IUserid);
                        if (objblPurchase == null)
                        {
                            objblPurchase = new blPurchase();
                        }
                        {
                            var_ret = objblPurchase.InsertUpdatePurchaseItem(dhDBnames, item);
                        }
                    }
                }
                return(var_ret);
            }
            catch (Exception ex) { throw ex; }
        }
Exemple #4
0
        public DataSet InsertUpdatePurchase(dhDBnames dhDBnames, dhPurchase objPurchase)
        {
            DataSet dsreturn = objDatabase.GetDataSet(dhDBnames, objPurchase, "xmlInsertUpdatePurchase");

            return(dsreturn);
        }