/// <summary> /// Add parameters while getting the stock details /// </summary> /// <param name="users"></param> /// <returns></returns> public IDbDataParameter[] AddParamsGetPurchaseDetails(PurchaseSearchDetails PurchaseSearchDetails) { parameters.Clear(); parameters.Add(dbManager.CreateParameter("@PurchaseId", 9, PurchaseSearchDetails.PurchaseId, DbType.Int32)); parameters.Add(dbManager.CreateParameter("@PurchaseLineId", 9, PurchaseSearchDetails.PurchaseLineId, DbType.Int32)); parameters.Add(dbManager.CreateParameter("@PurchaseInvoiceNo", 100, PurchaseSearchDetails.PurchaseInvoiceNo, DbType.String)); parameters.Add(dbManager.CreateParameter("@FromDate", PurchaseSearchDetails.FromDate, DbType.Date)); parameters.Add(dbManager.CreateParameter("@ToDate", PurchaseSearchDetails.ToDate, DbType.Date)); parameters.Add(dbManager.CreateParameter("@CustomerName", 100, PurchaseSearchDetails.SupplierName, DbType.String)); parameters.Add(dbManager.CreateParameter("@CustomerMobileNo", 14, PurchaseSearchDetails.SupplierMobileNo, DbType.Double)); parameters.Add(dbManager.CreateParameter("@BrandCode", 9, PurchaseSearchDetails.BrandCode, DbType.Int32)); parameters.Add(dbManager.CreateParameter("@BrandName", 200, PurchaseSearchDetails.BrandName, DbType.String)); parameters.Add(dbManager.CreateParameter("@OperationType", 2, PurchaseSearchDetails.OperationType, DbType.Int16)); return(parameters.ToArray()); }
private void GetDataGridDetails() { try { var PurchaseSearchDetails = new PurchaseSearchDetails { PurchaseInvoiceNo = PurchaseInvoiceNo, BrandName = BrandName, BrandCode = BrandCode, FromDate = FromDate, ToDate = ToDate, SupplierName = SupplierName, SupplierMobileNo = SupplierMobileNo, PurchaseId = PurchaseId, PurchaseLineId = PurchaseLineId, OperationType = OperationType }; if (OperationType != 3) { DtGridHeader.Clear(); DtGridHeader = _purchaseRepository.GetPurchaseDetails(PurchaseSearchDetails); LoadDataToHeaderGrid(); } else { DtGridList.Clear(); DtGridList = _purchaseRepository.GetPurchaseDetails(PurchaseSearchDetails); LoadDataToListGrid(); } } catch (Exception _exception) { CmC.InsertException(_exception); messageShow.singlemsgtext(CmC.ExceptionErrorMessage); } }
/// <summary> /// To get the purchase list for header and line.. /// </summary> /// <param name="users"></param> /// <returns></returns> public DataTable GetPurchaseDetails(PurchaseSearchDetails PurchaseSearchDetails) { var DbManager = new DBManager("DBConnection"); return(DbManager.GetDataTable(_StoredProcedures.GetPurchaseDetails_SP, CommandType.StoredProcedure, _PurchaseIRepository.AddParamsGetPurchaseDetails(PurchaseSearchDetails))); }