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 DataTable GetItemList(string ProductSizeID) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@ProductSizeID", Convert.ToInt32(ProductSizeID)); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "load_manufacturer_by_product_variation", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return(dt); }
public static DataTable InsertPurchaseReturnParent(string _PRDate, string _SupplierID, double _TotalPRAmount) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 5); param[0] = dbManager.getparam("@PRDate", _PRDate); param[1] = dbManager.getparam("@SupplierID", _SupplierID); param[2] = dbManager.getparam("@CreatedBy", bllUtility.LoggedInSystemInformation.LoggedUserId); param[3] = dbManager.getparam("@TerminalID", bllUtility.LoggedInSystemInformation.TerminalID); param[4] = dbManager.getparam("@TotalPRAmount", _TotalPRAmount); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_PurchaseReturnParent_Add]", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { MessageBox.Show(ex.ToString()); //return false; } finally { dbManager.Dispose(); } return(dt); }
public static DataTable InsertSalesParent(ProductSalesInfo objProductSalesInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 16); param[0] = dbManager.getparam("@TerminalID", objProductSalesInfo.TerminalID); param[1] = dbManager.getparam("@MemoNoteNo", Convert.ToInt64(objProductSalesInfo.MemoNoteNo)); param[2] = dbManager.getparam("@TotalAmount", Convert.ToDouble(objProductSalesInfo.TotalAmount)); param[3] = dbManager.getparam("@DiscountAmount", Convert.ToDouble(objProductSalesInfo.DiscountAmount)); param[4] = dbManager.getparam("@TotalGrossAmount", Convert.ToDouble(objProductSalesInfo.TotalGrossAmount)); param[5] = dbManager.getparam("@ReceivedAmount", Convert.ToDouble(objProductSalesInfo.ReceivedAmount)); double ChangeAmount = Convert.ToDouble(objProductSalesInfo.ChangeAmount); if (ChangeAmount < 0) { ChangeAmount = 0; } param[6] = dbManager.getparam("@ChangeAmount", ChangeAmount); param[7] = dbManager.getparam("@CreatedBy", Convert.ToInt64(objProductSalesInfo.CreatedBy)); param[8] = dbManager.getparam("@pk_code", ""); param[9] = dbManager.getparam("@SalesType", objProductSalesInfo.SalesType); param[10] = dbManager.getparam("@CustomerID", objProductSalesInfo.CustomerID); param[11] = dbManager.getparam("@SalesReturn", Convert.ToDouble(objProductSalesInfo.SalesReturn)); param[12] = dbManager.getparam("@RtlManager", objProductSalesInfo.RtlManager); param[13] = dbManager.getparam("@ZoneID", objProductSalesInfo.ZoneID); param[14] = dbManager.getparam("@CommissionAdjustAmount", Convert.ToDouble(objProductSalesInfo.CommissionAdjustAmount)); param[15] = dbManager.getparam("@AreaID", Convert.ToInt64(objProductSalesInfo.AreaID)); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_SalesParentInfo_Add]", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { //return false; } finally { dbManager.Dispose(); } return(dt); }
public static DataTable InsertUpdate(EmployeeInfo objEmployeeInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 19); param[0] = dbManager.getparam("@EmployeeID", objEmployeeInfo.EmployeeID.ToString()); param[1] = dbManager.getparam("@EmployeeName", objEmployeeInfo.EmployeeName.ToString()); param[2] = dbManager.getparam("@FathersName", objEmployeeInfo.FathersName.ToString()); param[3] = dbManager.getparam("@MothersName", objEmployeeInfo.MothersName.ToString()); param[4] = dbManager.getparam("@DepartmentID", objEmployeeInfo.DepartmentID.ToString()); param[5] = dbManager.getparam("@DesignationID", objEmployeeInfo.DesignationID.ToString()); param[6] = dbManager.getparam("@JoiningDate", objEmployeeInfo.JoiningDate.ToString()); param[7] = dbManager.getparam("@BirthDate", objEmployeeInfo.BirthDate.ToString()); param[8] = dbManager.getparam("@PresentAddress", objEmployeeInfo.PresentAddress.ToString()); param[9] = dbManager.getparam("@PermanentAddress", objEmployeeInfo.PermanentAddress.ToString()); param[10] = dbManager.getparam("@ContactNo", objEmployeeInfo.ContactNo.ToString()); param[11] = dbManager.getparam("@Photo", objEmployeeInfo.Photo); param[12] = dbManager.getparam("@Gender", objEmployeeInfo.Gender.ToString()); param[13] = dbManager.getparam("@MaritalStatus", objEmployeeInfo.MaritalStatus.ToString()); param[14] = dbManager.getparam("@ReferancePersonName", objEmployeeInfo.ReferancePersonName.ToString()); param[15] = dbManager.getparam("@RelationshipWithRefPerson", objEmployeeInfo.RelationshipWithRefPerson.ToString()); param[16] = dbManager.getparam("@ReferanceContactNo", objEmployeeInfo.ReferanceContactNo.ToString()); param[17] = dbManager.getparam("@Activity", objEmployeeInfo.Activity.ToString()); param[18] = dbManager.getparam("@CreatedBy", objEmployeeInfo.CreatedBy.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_EmployeeInfo_InsertUpdate", param); dt = dbManager.GetDataTable(cmd); //dt = dbManager.ExecuteNonQuery(cmd); } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return(dt); }
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 Authontication(string iUserName, string iPassword) { bool IsAuthentic = false; DataTable dt = new DataTable(); ISalesPOSDBManager dbManager = new SalesPOSDBManager(); UserInfo iUserInfo = new UserInfo(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2); param[0] = dbManager.getparam("@user_id", iUserName); param[1] = dbManager.getparam("@user_password", iPassword); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_AuthonticationCheck", param); dt = dbManager.GetDataTable(cmd); if (dt.Rows.Count > 0) { bllUtility.LoggedInSystemInformation.LoggedUserId = Convert.ToInt64(dt.Rows[0]["UserInfoId"].ToString()); bllUtility.LoggedInSystemInformation.UserName = dt.Rows[0]["UserName"].ToString(); bllUtility.LoggedInSystemInformation.IsAdmin = Convert.ToBoolean(dt.Rows[0]["IsAdmin"]); IsAuthentic = true; iUserInfo.UserInfoId = Convert.ToInt64(dt.Rows[0]["UserInfoId"]); } else { IsAuthentic = false; } } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return(IsAuthentic); }
public static DataTable Receive_Warrenty_Product(WarrentyService obj) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 17); param[0] = dbManager.getparam("@ProductSizeID", obj.ProductSizeID); param[1] = dbManager.getparam("@Manufacturer", obj.Manufacturer); param[2] = dbManager.getparam("@SerialNo", obj.SerialNo); param[3] = dbManager.getparam("@IsWarrentyApplicable", obj.IsWarrentyApplicable); param[4] = dbManager.getparam("@IsNewFareAdded", obj.IsNewFareAdded); param[5] = dbManager.getparam("@Status", obj.Status); param[6] = dbManager.getparam("@VehicleNo", obj.VehicleNo); param[7] = dbManager.getparam("@CustomerID", obj.CustomerID); param[8] = dbManager.getparam("@CustomerName", obj.CustomerName); param[9] = dbManager.getparam("@Address", obj.Address); param[10] = dbManager.getparam("@WarrentyExpiredDate", obj.WarrentyExpiredDate); param[11] = dbManager.getparam("@TotalServiceAmount", obj.TotalServiceAmount); param[12] = dbManager.getparam("@DiscountAmount", obj.DiscountAmount); param[13] = dbManager.getparam("@PaidAmount", obj.PaidAmount); param[14] = dbManager.getparam("@ReadyForGatePass", obj.ReadyForGatePass); param[15] = dbManager.getparam("@IsPaid", obj.IsPaid); param[16] = dbManager.getparam("@CreatedBy", bllUtility.LoggedInSystemInformation.LoggedUserId); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[insert_service_parent]", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return(dt); }
public static DataTable Insert(ProductInfo objProductInfo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 13); param[0] = dbManager.getparam("@ActivityID", objProductInfo.ActivityID); param[1] = dbManager.getparam("@ProductDescription", objProductInfo.ProductDescription.ToString()); param[2] = dbManager.getparam("@ProductName", objProductInfo.ProductName.ToString()); param[3] = dbManager.getparam("@ReorderLevel", objProductInfo.ReorderLevel); param[4] = dbManager.getparam("@SectionId", objProductInfo.SectionId); param[5] = dbManager.getparam("@SubSectionID", objProductInfo.SubSectionID); param[6] = dbManager.getparam("@VatId", objProductInfo.VatId); param[7] = dbManager.getparam("@ManufacturerID", objProductInfo.ManufacturerID); param[8] = dbManager.getparam("@CreatedBy", objProductInfo.CreatedBy.ToString()); //param[9] = dbManager.getparam("@pk_code", ""); param[9] = dbManager.getparam("@IsFractionAllow", objProductInfo.IsFractionAllow); param[10] = dbManager.getparam("@TypeID", objProductInfo.TypeID); param[11] = dbManager.getparam("@OtherCode", objProductInfo.OtherCode.ToString()); param[12] = dbManager.getparam("@ProductID", objProductInfo.ProductID.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "dbo.USP_ProductInfo_Add", param); //dt = dbManager.ExecuteQuery(cmd); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { //return false; } finally { dbManager.Dispose(); } return(dt); }
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 DataTable GetAccTransDetails(AccountTransaction objAccountTransaction, string AmountTo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { //double AmountSearch = 0.00; //if (objAccountTransaction.SearchAmount == "") // AmountSearch = 0.00; //else // AmountSearch =Convert.ToDouble(objAccountTransaction.SearchAmount); dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 8); param[0] = dbManager.getparam("@ATTID", objAccountTransaction.SearchATTID); param[1] = dbManager.getparam("@AccountNo", objAccountTransaction.SearchAccountNo); param[2] = dbManager.getparam("@DateFrom", objAccountTransaction.SearchDateFrom); param[3] = dbManager.getparam("@DateTo", objAccountTransaction.SearchDateTo); param[4] = dbManager.getparam("@IsEditable", objAccountTransaction.SearchIsEditable); param[5] = dbManager.getparam("@ref", objAccountTransaction.SearchRef); param[6] = dbManager.getparam("@AmountFrom", objAccountTransaction.SearchAmount); param[7] = dbManager.getparam("@AmountTo", AmountTo); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_GetAccTransDetails]", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { //return false; MessageBox.Show(ex.ToString()); } finally { dbManager.Dispose(); } return(dt); }
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 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 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 DataTable GetProductMainStock(string ProductID) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@ProductID", ProductID); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_GetProductMainStock]", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { //return false; } finally { dbManager.Dispose(); } return(dt); }
public static DataTable GetSalesInvoiceDetails(string strInvoiceNo) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@InvoiceNo", strInvoiceNo); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "[dbo].[USP_GetSalesInvoiceDetails]", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { } finally { dbManager.Dispose(); } return(dt); }
public static bool MenuAuthontication(long iUserInfoId, int iMenuId) { bool IsAuthentic = false; DataTable dt = new DataTable(); ISalesPOSDBManager dbManager = new SalesPOSDBManager(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 2); param[0] = dbManager.getparam("@UserInfoId", iUserInfoId); param[1] = dbManager.getparam("@MenuId", iMenuId); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "USP_UserMenuAuthonticationCheck", param); dt = dbManager.GetDataTable(cmd); if (dt.Rows.Count > 0) { IsAuthentic = true; } else { IsAuthentic = false; } } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return IsAuthentic; }
public static DataTable getMaterialByID(Int64 ConfigID) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@ConfigID", ConfigID); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "get_material_info_by_id", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return(dt); }
public static DataTable getById(string ProductID) { ISalesPOSDBManager dbManager = new SalesPOSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = SalesPOSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@ProductID", ProductID); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_productinfo_getbyId", param); dt = dbManager.GetDataTable(cmd); } catch (Exception ex) { throw (ex); } finally { dt.Dispose(); dbManager.Dispose(); } return(dt); }
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); }
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); }