public static bool InsertSalesPayment(SalesPaymentInfo objSalesPaymentInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); bool isSave = true; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 8); param[0] = dbManager.getparam("@InvoiceNo", objSalesPaymentInfo.InvoiceNo); param[1] = dbManager.getparam("@PayTypeId", Convert.ToInt64(objSalesPaymentInfo.PayTypeId)); param[2] = dbManager.getparam("@PaidAmount", Convert.ToDouble(objSalesPaymentInfo.PaidAmount)); param[3] = dbManager.getparam("@CardNo", objSalesPaymentInfo.CardNo); param[4] = dbManager.getparam("@ExpDate", objSalesPaymentInfo.ExpDate); param[5] = dbManager.getparam("@CustomerID", objSalesPaymentInfo.CustomerID); param[6] = dbManager.getparam("@TerminalID", objSalesPaymentInfo.TerminalID); param[7] = dbManager.getparam("@CreatedBy", Convert.ToInt64(objSalesPaymentInfo.CreatedBy)); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SalesPaymentInfo_Add]", param); dbManager.ExecuteQuery(cmd); } catch (Exception ex) { isSave = false; } finally { dbManager.Dispose(); } return(isSave); }
public static bool InsertSalesRequisitionList(string InvoiceID, string RequisitionID) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); bool isSaved = true; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2); param[0] = dbManager.getparam("@InvoiceID", InvoiceID); param[1] = dbManager.getparam("@RequisitionID", RequisitionID); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[insert_SalesRequisitionList]", param); dbManager.ExecuteQuery(cmd); } catch (Exception ex) { MessageBox.Show(ex.ToString()); isSaved = false; } finally { dbManager.Dispose(); } return(isSaved); }
public static bool InsertUpdateDefaultSetting(string iID, string iDefaultSaleType, string iSalesPriceIsEditable, string iDiscountAllow, string iMiniAccAllow, string iCreditSaleAllow, string iSalesInvoicePrintType) { bool IsSave = false; DataTable dt = new DataTable(); ISalesPOSDBManager dbManager = new SalesPOSDBManager(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 7); param[0] = dbManager.getparam("@ID", iID); param[1] = dbManager.getparam("@DefaultSaleType", iDefaultSaleType); param[2] = dbManager.getparam("@SalesPriceIsEditable", iSalesPriceIsEditable); param[3] = dbManager.getparam("@DiscountAllow", iDiscountAllow); param[4] = dbManager.getparam("@MiniAccAllow", iMiniAccAllow); param[5] = dbManager.getparam("@CreditSaleAllow", iCreditSaleAllow); param[6] = dbManager.getparam("@SalesInvoicePrintType", iSalesInvoicePrintType); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_SofDefaultSettingsInsertUpdate", param); IsSave = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return(IsSave); }
public static bool InsertPurchaseReturnChild(Int32 _PRID, string _ProductID, Int32 _UnitID, decimal _Quantity, decimal _ReturnUnitPrice, decimal _ReturnTotalPrice) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); bool isSave = true; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 6); param[0] = dbManager.getparam("@PRID", _PRID); param[1] = dbManager.getparam("@ProductID", _ProductID); param[2] = dbManager.getparam("@UnitID", _UnitID); param[3] = dbManager.getparam("@Quantity", _Quantity); param[4] = dbManager.getparam("@ReturnUnitPrice", _ReturnUnitPrice); param[5] = dbManager.getparam("@TotalReturnPrice", _ReturnTotalPrice); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[USP_PurchaseReturnChild_Add]", param); dbManager.ExecuteQuery(cmd); } catch (Exception ex) { isSave = false; MessageBox.Show(ex.ToString()); } finally { dbManager.Dispose(); } return(isSave); }
public static bool Update(BranchInfo objBranchInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 15); param[0] = dbManager.getparam("@ActivationDate", objBranchInfo.ActivationDate); param[1] = dbManager.getparam("@ActivityID", objBranchInfo.ActivityID.ToString()); param[2] = dbManager.getparam("@Address", objBranchInfo.Address.ToString()); param[3] = dbManager.getparam("@BranchCode", objBranchInfo.BranchCode.ToString()); param[4] = dbManager.getparam("@BranchName", objBranchInfo.BranchName.ToString()); param[5] = dbManager.getparam("@CompanyID", objBranchInfo.CompanyID.ToString()); param[6] = dbManager.getparam("@ContactNumber", objBranchInfo.ContactNumber.ToString()); param[7] = dbManager.getparam("@UpdatedBy", objBranchInfo.UpdatedBy.ToString()); param[8] = dbManager.getparam("@UpdatedDate", objBranchInfo.UpdatedDate); param[9] = dbManager.getparam("@Email", objBranchInfo.Email.ToString()); param[10] = dbManager.getparam("@ExpireDate", objBranchInfo.ExpireDate); param[11] = dbManager.getparam("@FAX", objBranchInfo.FAX.ToString()); param[12] = dbManager.getparam("@VatRegistrationNo", objBranchInfo.VatRegistrationNo.ToString()); param[13] = dbManager.getparam("@WebURL", objBranchInfo.WebURL.ToString()); param[14] = dbManager.getparam("@BranchID", objBranchInfo.BranchID.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_BranchInfo_Update", param); chk = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { MessageBox.Show(ex.ToString()); return(false); } finally { dbManager.Dispose(); } return(chk); }
public static bool Update(ProductInfo objProductInfo, string old_product_code) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 15); param[0] = dbManager.getparam("@ActivityID", objProductInfo.ActivityID); param[1] = dbManager.getparam("@ProductDescription", objProductInfo.ProductDescription.ToString()); param[2] = dbManager.getparam("@ProductName", objProductInfo.ProductName); param[3] = dbManager.getparam("@ReorderLevel", objProductInfo.ReorderLevel); param[4] = dbManager.getparam("@SectionId", objProductInfo.SectionId); param[5] = dbManager.getparam("@ProductID", objProductInfo.ProductID); param[6] = dbManager.getparam("@SubSectionID", objProductInfo.SubSectionID); param[7] = dbManager.getparam("@VatId", objProductInfo.VatId.ToString()); param[8] = dbManager.getparam("@ManufacturerID", objProductInfo.ManufacturerID.ToString()); param[9] = dbManager.getparam("@UpdatedBy", objProductInfo.UpdatedBy.ToString()); param[10] = dbManager.getparam("@IsFractionAllow", objProductInfo.IsFractionAllow); param[11] = dbManager.getparam("@TypeID", objProductInfo.TypeID); param[12] = dbManager.getparam("@OtherCode", objProductInfo.OtherCode); param[13] = dbManager.getparam("@SerialNo", objProductInfo.SerialNo); param[14] = dbManager.getparam("@old_product_code", old_product_code); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_productInfo_Update", param); chk = dbManager.ExecuteQuery(cmd); //dbManager.ExecuteReader(cmd); } catch (Exception ex) { return(false); } finally { dbManager.Dispose(); } return(chk); }
public static bool Insert(AccountHolderInfo objAccountHolderInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 10); param[0] = dbManager.getparam("@AccHolderName", objAccountHolderInfo.AccHolderName.ToString()); param[1] = dbManager.getparam("@AccountHolderTypeID", objAccountHolderInfo.AccountHolderTypeID.ToString()); //param[2] = dbManager.getparam("@AccountNo", objAccountHolderInfo.AccountNo.ToString()); param[2] = dbManager.getparam("@ActivityID", objAccountHolderInfo.ActivityID); param[3] = dbManager.getparam("@Address", objAccountHolderInfo.Address.ToString()); param[4] = dbManager.getparam("@ContactNo", objAccountHolderInfo.ContactNo); param[5] = dbManager.getparam("@CreatedDate", objAccountHolderInfo.CreatedDate); param[6] = dbManager.getparam("@CreatedBy", objAccountHolderInfo.CreatedBy.ToString()); param[7] = dbManager.getparam("@IsDeleted", false); param[8] = dbManager.getparam("@ZoneID", objAccountHolderInfo.ZoneID); param[9] = dbManager.getparam("@RSMID", objAccountHolderInfo.RSMID); //objAccountHolderInfo.AccountNo.ToString().Substring(3); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_AccountHolderInfo_Add", param); chk = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { return(false); MessageBox.Show(ex.ToString()); } finally { dbManager.Dispose(); } return(chk); }
public static bool InsertSalesDetails(ProductSalesDetailsInfo objProductSalesDetailsInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); bool isSave = true; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 15); param[0] = dbManager.getparam("@InvoiceNo", objProductSalesDetailsInfo.InvoiceNo); param[1] = dbManager.getparam("@ProductID", objProductSalesDetailsInfo.ProductID); param[2] = dbManager.getparam("@ActualQty", bllUtility.Val(objProductSalesDetailsInfo.ActualQty)); param[3] = dbManager.getparam("@ActualUnitID", Convert.ToInt64(objProductSalesDetailsInfo.ActualUnitID)); param[4] = dbManager.getparam("@ActualUnitSalesPrice", Convert.ToDouble(objProductSalesDetailsInfo.ActualUnitSalesPrice)); param[5] = dbManager.getparam("@TotalPriceWithoutVat", Convert.ToDouble(objProductSalesDetailsInfo.TotalPriceWithoutVat)); param[6] = dbManager.getparam("@VatID", Convert.ToInt64(objProductSalesDetailsInfo.VatID)); param[7] = dbManager.getparam("@VatPerchantage", Convert.ToDouble(objProductSalesDetailsInfo.VatPerchantage)); param[8] = dbManager.getparam("@VatAmount", Convert.ToDouble(objProductSalesDetailsInfo.VatAmount)); param[9] = dbManager.getparam("@TotalPriceWithVat", Convert.ToDouble(objProductSalesDetailsInfo.TotalPriceWithVat)); param[10] = dbManager.getparam("@DiscountAmount", Convert.ToDouble(objProductSalesDetailsInfo.DiscountAmount)); param[11] = dbManager.getparam("@ConvertedUnitID", Convert.ToInt64(objProductSalesDetailsInfo.ConvertedUnitID)); param[12] = dbManager.getparam("@CovertedQuantity", bllUtility.Val(objProductSalesDetailsInfo.CovertedQuantity)); param[13] = dbManager.getparam("@ItemType", Convert.ToInt64(objProductSalesDetailsInfo.ItemType)); param[14] = dbManager.getparam("@DiscountPercent", Convert.ToDouble(objProductSalesDetailsInfo.DiscountPercent)); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SalesProcess]", param); dbManager.ExecuteQuery(cmd); } catch (Exception ex) { isSave = false; } finally { dbManager.Dispose(); } return(isSave); }
public static bool Exec_Store_Procedure(string store_procedure) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); bool chk = true; try { dbManager.Open(); IDbDataParameter[] param = null; IDbCommand cmd = dbManager.getCommand(CommandType.Text, store_procedure, param); dbManager.ExecuteQuery(cmd); } catch (Exception ex) { chk = false; MessageBox.Show(ex.ToString()); } finally { dbManager.Dispose(); } return(chk); }
public static bool InsertPurchaseMasterDetails(string purchaseID, string productID, string unitID, string purchaseQty, string purchasePrice, string createdBy, string isExpDate, string expDate, int areaId, string UnitPurchasePrice) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 10); param[0] = dbManager.getparam("@PurchaseID", purchaseID); param[1] = dbManager.getparam("@ProductID", productID); param[2] = dbManager.getparam("@UnitID", Convert.ToInt32(unitID)); param[3] = dbManager.getparam("@PurchaseQty", Convert.ToDouble(purchaseQty)); param[4] = dbManager.getparam("@PurchasePrice", Convert.ToDouble(purchasePrice)); param[5] = dbManager.getparam("@CreatedBy", Convert.ToInt32(createdBy)); param[6] = dbManager.getparam("@IsExpDate", isExpDate); param[7] = dbManager.getparam("@ProductExpireDate", expDate); param[8] = dbManager.getparam("@AreaID", areaId); param[9] = dbManager.getparam("@UnitPurchasePrice", Convert.ToDouble(UnitPurchasePrice)); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_ProductLotDetailsEntry", param); dbManager.ExecuteQuery(cmd); chk = true; } catch (Exception ex) { return(false); MessageBox.Show(ex.ToString()); } finally { dbManager.Dispose(); } return(chk); }
public static bool Delete(string RequisitionID) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); bool isDeleted = true; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2); param[0] = dbManager.getparam("@RequisitionID", RequisitionID); param[1] = dbManager.getparam("@UserID", bllUtility.LoggedInSystemInformation.LoggedUserId.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[delete_requisition]", param); dbManager.ExecuteQuery(cmd); } catch (Exception ex) { isDeleted = false; } finally { dbManager.Dispose(); } return(isDeleted); }
public static bool Delete(string ManufacturerID) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@ManufacturerID", ManufacturerID); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_manufacturerinfo_delete", param); chk = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { return(false); } finally { dbManager.Dispose(); } return(chk); }
public static bool Insert(TerminalInfo objTerminalInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 9); //param[0] = dbManager.getparam("@UnitId", objUnitInfo.UnitId.ToString()); param[0] = dbManager.getparam("@TerminalName", objTerminalInfo.TerminalName.ToString()); param[1] = dbManager.getparam("@Attribute", objTerminalInfo.Attribute.ToString()); param[2] = dbManager.getparam("@ValueOfAttribute", objTerminalInfo.ValueOfAttribute.ToString()); param[3] = dbManager.getparam("@ActivationDate", objTerminalInfo.ActivationDate); param[4] = dbManager.getparam("@ActivityID", objTerminalInfo.ActivityID.ToString()); param[5] = dbManager.getparam("@ExpireDate", objTerminalInfo.ExpireDate); param[6] = dbManager.getparam("@CreatedDate", objTerminalInfo.CreatedDate); param[7] = dbManager.getparam("@CreatedBy", objTerminalInfo.CreatedBy.ToString()); param[8] = dbManager.getparam("@IsDeleted", false); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_TerminalInfo_Add", param); chk = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { return(false); MessageBox.Show(ex.ToString()); } finally { dbManager.Dispose(); } return(chk); }
public static bool UpdateData(AccountTransaction objAccountTransaction) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 9); param[0] = dbManager.getparam("@ATID", Convert.ToInt64(objAccountTransaction.ATID)); param[1] = dbManager.getparam("@TransactionDate", objAccountTransaction.TransactionDate.ToString()); param[2] = dbManager.getparam("@TerminalID", Convert.ToInt64(objAccountTransaction.TerminalID)); param[3] = dbManager.getparam("@AccountNo", objAccountTransaction.AccountHolderID.ToUpper()); param[4] = dbManager.getparam("@ATTID", Convert.ToInt64(objAccountTransaction.ATTID)); param[5] = dbManager.getparam("@Description", objAccountTransaction.Description); param[6] = dbManager.getparam("@Amount", Convert.ToDecimal(objAccountTransaction.Debit)); param[7] = dbManager.getparam("@UpdatedBy", Convert.ToInt64(objAccountTransaction.CreatedBy)); param[8] = dbManager.getparam("@RefNo", objAccountTransaction.RefNo); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_AccountTransactionDetailsInfo_Update]", param); chk = dbManager.ExecuteQuery(cmd); //dbManager.ExecuteReader(cmd); } catch (Exception ex) { return(false); MessageBox.Show(ex.ToString()); } finally { dbManager.Dispose(); } return(chk); }