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); }
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); }
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; } }
public DataSet InsertUpdatePurchase(dhDBnames dhDBnames, dhPurchase objPurchase) { DataSet dsreturn = objDatabase.GetDataSet(dhDBnames, objPurchase, "xmlInsertUpdatePurchase"); return(dsreturn); }