public List <ClsFileManager> SaveModuleFile(Int64 FileManagerID, Int64 ModuleID, string ModuleType, string FileIdentifier, int Sequence) { try { List <ClsFileManager> ObjFileManager = new List <ClsFileManager>(); if (HttpContext.Current.Request.ContentLength > 0) { var httpRequest = HttpContext.Current.Request; foreach (string file in httpRequest.Files) { string FilePath = HttpContext.Current.Server.MapPath("~/FileStorage/" + ModuleType + "/"); string StoreFilePath = "/FileStorage/" + ModuleType + "/"; if (!Directory.Exists(FilePath)) { Directory.CreateDirectory(FilePath); } var postedFile = httpRequest.Files[file]; string FileName = AppendTimeStamp(postedFile.FileName); FilePath = Path.Combine(FilePath, FileName); postedFile.SaveAs(FilePath); DBParameterCollection ObJParameterCOl = new DBParameterCollection(); DBParameter objDBParameter = new DBParameter("@FileManagerID", FileManagerID, DbType.Int64); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@ModuleID", ModuleID, DbType.Int64); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@ModuleType", ModuleType, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FileIdentifier", FileIdentifier, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FileName", FileName, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FilePath", StoreFilePath + FileName, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FileExtension", Path.GetExtension(FilePath), DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FileType", postedFile.ContentType, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FileSize", postedFile.ContentLength, DbType.Int64); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FileSequence", Sequence, DbType.Int32); ObJParameterCOl.Add(objDBParameter); DBHelper objDbHelper = new DBHelper(); FileManagerID = Convert.ToInt64(objDbHelper.ExecuteScalar(Constant.SaveModuleFile, ObJParameterCOl, CommandType.StoredProcedure)); ClsFileManager FileManager = new ClsFileManager(); FileManager.FileManagerID = FileManagerID; FileManager.ModuleID = ModuleID; FileManager.FileIdentifier = FileIdentifier; FileManager.FileName = FileName; FileManager.FilePath = StoreFilePath + FileName; FileManager.FileType = postedFile.ContentType; FileManager.FileSize = postedFile.ContentLength; FileManager.FileExtension = Path.GetExtension(FilePath); FileManager.ModuleType = ModuleType; FileManager.Sequence = Sequence; ObjFileManager.Add(FileManager); } return(ObjFileManager); } else { return(ObjFileManager); } } catch (Exception ex) { throw ex; } }
public int StdData(MStandardization std) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@RMRId", std.RMRId)); paramCollection.Add(new DBParameter("@QualityId", std.QualityId)); paramCollection.Add(new DBParameter("@StdDate", std.StandardDate)); paramCollection.Add(new DBParameter("@StdShiftId", std.StdShiftId)); paramCollection.Add(new DBParameter("@SiloNo", std.SiloNo)); paramCollection.Add(new DBParameter("@RCMQuantity", std.RCMQuantity)); paramCollection.Add(new DBParameter("@StdStartTime", std.StandardizationStartTime)); paramCollection.Add(new DBParameter("@StdEndTime", std.StandardizationEndTime)); paramCollection.Add(new DBParameter("@CuttingMilkQuantity", std.CuttingMilkQuantity)); paramCollection.Add(new DBParameter("@CuttingMilkFat", std.CuttingMilkFAT)); paramCollection.Add(new DBParameter("@CuttingMilkSNF", std.CuttingMilkSNF)); paramCollection.Add(new DBParameter("@Skim", std.Skim)); //paramCollection.Add(new DBParameter("@Qty", std.Qty)); paramCollection.Add(new DBParameter("@SkimFAT", std.SkimFAT)); paramCollection.Add(new DBParameter("@SkimSNF", std.SkimSNF)); paramCollection.Add(new DBParameter("@RCM", std.RCM)); paramCollection.Add(new DBParameter("@SMP", std.SMP)); paramCollection.Add(new DBParameter("@CreamAdd", std.CreamAdd)); paramCollection.Add(new DBParameter("@CreamProduced", std.CreamProduced)); paramCollection.Add(new DBParameter("@StandardizationStatusId", std.StandardizationStatusId)); //paramCollection.Add(new DBParameter("@TotalQuantity", std.TotalQuantity)); //paramCollection.Add(new DBParameter("@TypeOfMilk", std.TypeOfMilk)); paramCollection.Add(new DBParameter("@Remarks", std.Remarks)); //paramCollection.Add(new DBParameter("@Custom1", std.Custom1)); //paramCollection.Add(new DBParameter("@Custom2", std.Custom2)); //paramCollection.Add(new DBParameter("@Custom3", std.Custom3)); //paramCollection.Add(new DBParameter("@Custom4", std.Custom4)); //paramCollection.Add(new DBParameter("@Custom5", std.Custom5)); paramCollection.Add(new DBParameter("@flag", std.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_Standardization", paramCollection, CommandType.StoredProcedure); } catch (Exception EX) { string MSG = EX.ToString(); } return(result); }
public bool SaveUnassembleVoucherItem(Item_VoucherModel item) { string Query = string.Empty; bool isSaved = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@UAVoucher_ID", item.ParentId)); paramCollection.Add(new DBParameter("@UA_Item", item.Item)); paramCollection.Add(new DBParameter("@UA_Batch", item.Batch)); paramCollection.Add(new DBParameter("@UA_Qty", item.Qty)); paramCollection.Add(new DBParameter("@UA_Unit", item.Unit)); paramCollection.Add(new DBParameter("@UA_Price", item.Price)); paramCollection.Add(new DBParameter("@UA_Amount", item.Amount)); paramCollection.Add(new DBParameter("@TotalQty", item.TotalQty)); paramCollection.Add(new DBParameter("@TotalAmount", item.TotalAmount)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now)); Query = "INSERT INTO Trans_Unassemble_Items ([Unassemble_Id],[Item],[Batch],[Qty],[Unit]," + "[Price],[Amount],[TotalQty],[TotalAmount],[CreatedBy],[CreatedDate]) VALUES" + "(@UAVoucher_ID,@UA_Item,@UA_Batch,@UA_Qty,@UA_Unit,@UA_Price,@UA_Amount,@TotalQty,@TotalAmount,@CreatedBy,@CreatedDate)"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { isSaved = true; } } catch (Exception ex) { isSaved = false; throw ex; } return(isSaved); }
public bool SaveJournalVoucher(JournalVoucherModel objjvmodel) { string Query = string.Empty; bool isSaved = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@VoucherNumber", objjvmodel.Voucher_Number)); paramCollection.Add(new DBParameter("@Series", objjvmodel.Voucher_Series)); paramCollection.Add(new DBParameter("@JVDate", objjvmodel.JV_Date, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@Type", objjvmodel.Type)); paramCollection.Add(new DBParameter("@PDCDate", objjvmodel.PDCDate, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@LongNarration", objjvmodel.LongNarration)); paramCollection.Add(new DBParameter("@TotalCreditAmount", objjvmodel.TotalCreditAmt, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalDebitAmount", objjvmodel.TotalDebitAmt, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); System.Data.IDataReader dr = _dbHelper.ExecuteDataReader("spInsertJournalMaster", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); int id = 0; dr.Read(); id = Convert.ToInt32(dr[0]); SaveJVAccounts(objjvmodel.JournalAccountModel, id); } catch (Exception ex) { isSaved = false; throw ex; } return(isSaved); }
//Update Journal Voucher public bool UpdateJournalVoucher(JournalVoucherModel objjvmodel) { string Query = string.Empty; bool isUpdated = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@VoucherNumber", objjvmodel.Voucher_Number)); paramCollection.Add(new DBParameter("@Series", objjvmodel.Voucher_Series)); paramCollection.Add(new DBParameter("@JVDate", objjvmodel.JV_Date, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@Type", objjvmodel.Type)); paramCollection.Add(new DBParameter("@PDCDate", objjvmodel.PDCDate, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@LongNarration", objjvmodel.LongNarration)); paramCollection.Add(new DBParameter("@TotalCreditAmount", objjvmodel.TotalCreditAmt, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalDebitAmount", objjvmodel.TotalDebitAmt, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@CreatedBy", "")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "Admin")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@JournalId", objjvmodel.JV_Id)); System.Data.IDataReader dr = _dbHelper.ExecuteDataReader("spUpdateJournalMaster", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); List <AccountModel> lstAcct = new List <AccountModel>(); foreach (AccountModel act in objjvmodel.JournalAccountModel) { act.ParentId = objjvmodel.JV_Id; if (act.AC_Id > 0) { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@ParentId", (act.ParentId))); paramCollection.Add(new DBParameter("@ACT_ID", (act.AC_Id))); paramCollection.Add(new DBParameter("@DC", (act.DC))); paramCollection.Add(new DBParameter("@Account", act.Account)); paramCollection.Add(new DBParameter("@LegderId", act.LedgerId)); paramCollection.Add(new DBParameter("@DebitAmount", act.Debit, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@CreditAmount", act.Credit, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@Narration", act.Narration)); paramCollection.Add(new DBParameter("@CreatedBy", "")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "Admin")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); Query = "UPDATE journal_voucher_details SET `DC`=@DC,`Account`=@Account,`LegderId`=@LegderId,`Debit`=@DebitAmount,`Credit`=@CreditAmount," + "`Narration`=@Narration,`CreatedBy`=@CreatedBy,`CreatedDate`=@CreatedDate,`ModifiedBy`=@ModifiedBy,`ModifiedDate`=@ModifiedDate " + "WHERE `AC_Id`=@ACT_ID AND `JV_Id`=@ParentId"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { isUpdated = true; } } else { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@JournalId", (act.ParentId))); paramCollection.Add(new DBParameter("@DC", (act.DC))); paramCollection.Add(new DBParameter("@Account", act.Account)); paramCollection.Add(new DBParameter("@LegderId", act.LedgerId)); paramCollection.Add(new DBParameter("@DebitAmount", act.Debit, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@CreditAmount", act.Credit, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@Narration", act.Narration)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); System.Data.IDataReader JAdr = _dbHelper.ExecuteDataReader("spInsertJournalDetails", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); } } } catch (Exception ex) { isUpdated = false; //throw ex; } return(isUpdated); }
public bool SavePhysicalStock(PhysicalStockModel objphysical) { string Query = string.Empty; bool isSaved = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@VoucherNo", objphysical.Voucher_Number)); paramCollection.Add(new DBParameter("@Date", objphysical.PSDate, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@Matcenter", objphysical.MatCenter)); paramCollection.Add(new DBParameter("@Narration", objphysical.Narration)); paramCollection.Add(new DBParameter("@Series", objphysical.SVSeries)); paramCollection.Add(new DBParameter("@JournalVoucher", objphysical.StockJournalVoucher, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@InputSub", objphysical.InputSubDetails, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@UpdateVoucher", objphysical.UpdateVoucher, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@ScannBarCode", objphysical.ScannBarcode, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@Items", objphysical.Items, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@BSN", objphysical.BCN, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@SerialNo", objphysical.SerialNo, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@Batch", objphysical.Batch, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); //paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now)); Query = "INSERT INTO Physical_Stock_Voucher ([VoucherNo],[Physical_Date],[MatCenter],[Narration],[Journal Series]," + "[Journal Voucher],[Input Sub],[Scann Barcode],[Update Journal Narration],[Items],[BCN],[SerialNo],[Batch],[CreatedBy]) VALUES " + "(@VoucherNo,@Date,@Matcenter,@Narration,@Series,@JournalVoucher,@InputSub,@UpdateVoucher,@ScannBarCode,@Items," + " @BSN,@SerialNo,@Batch,@CreatedBy)"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { SavePhysicalStockItems(objphysical.StockItemsModel); isSaved = true; } } catch (Exception ex) { isSaved = false; throw ex; } return(isSaved); }
//Update Sales Voucher public bool UpdateSalesVoucherMaster(eSunSpeedDomain.TransSalesModel objSales) { string Query = string.Empty; bool isUpdated = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@VoucherType", objSales.VoucherType)); paramCollection.Add(new DBParameter("@SaleDate", objSales.SaleDate, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@Terms", objSales.Terms)); paramCollection.Add(new DBParameter("@VoucherNumber", objSales.VoucherNumber)); paramCollection.Add(new DBParameter("@BillNumber", objSales.BillNo)); paramCollection.Add(new DBParameter("@LedgerId", objSales.LedgerId)); paramCollection.Add(new DBParameter("@SalesType", objSales.SalesType)); paramCollection.Add(new DBParameter("@MatCentre", objSales.MatCentre)); paramCollection.Add(new DBParameter("@Narration", objSales.Narration)); paramCollection.Add(new DBParameter("@TotalAmount", objSales.TotalAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalQty", objSales.TotalQty, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalFree", objSales.TotalFree, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalBasicAmount", objSales.TotalBasicAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalDisAmount", objSales.TotalDisAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalTaxAmount", objSales.TotalTaxAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@BSTotalAmount", objSales.BSTotalAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@PriceList", objSales.PriceList)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, DbType.DateTime)); paramCollection.Add(new DBParameter("@Trans_Sales_Id", objSales.Trans_Sales_Id)); System.Data.IDataReader dr = _dbHelper.ExecuteDataReader("spUpdateSalesVoucherMaster", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); //Update Sale Item Details foreach (Item_VoucherModel item in objSales.SalesItem_Voucher) { item.ParentId = objSales.Trans_Sales_Id; if (item.Item_ID > 0) { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Trans_Sales_Id", item.ParentId)); paramCollection.Add(new DBParameter("@ChalidId", item.Item_ID)); paramCollection.Add(new DBParameter("@ItemMastid", item.ITM_Id)); paramCollection.Add(new DBParameter("@LedgerId", item.LedgerId)); paramCollection.Add(new DBParameter("@Qty", item.Qty, DbType.Decimal)); paramCollection.Add(new DBParameter("@Unit", item.Unit)); paramCollection.Add(new DBParameter("@Per", item.Per)); paramCollection.Add(new DBParameter("@Price", item.Price, DbType.Decimal)); paramCollection.Add(new DBParameter("@Batch", item.Batch)); paramCollection.Add(new DBParameter("@Free", item.Free, DbType.Decimal)); paramCollection.Add(new DBParameter("@BasicAmt", item.BasicAmt, DbType.Decimal)); paramCollection.Add(new DBParameter("@DiscountPercentage", item.DiscountPercentage, DbType.Decimal)); paramCollection.Add(new DBParameter("@DiscountAmount", item.DiscountAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TaxAmount", item.TaxAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@Amount", item.Amount, DbType.Decimal)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); System.Data.IDataReader Idr = _dbHelper.ExecuteDataReader("spUpdateSalesVoucherItemDetails", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); } else { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Trans_Sales_Id", item.ParentId)); paramCollection.Add(new DBParameter("@Itemid", item.ITM_Id)); paramCollection.Add(new DBParameter("@LedgerId", item.LedgerId)); paramCollection.Add(new DBParameter("@Qty", item.Qty, DbType.Decimal)); paramCollection.Add(new DBParameter("@Unit", item.Unit)); paramCollection.Add(new DBParameter("@Per", item.Per)); paramCollection.Add(new DBParameter("@Price", item.Price, DbType.Decimal)); paramCollection.Add(new DBParameter("@Batch", item.Batch)); paramCollection.Add(new DBParameter("@Free", item.Free, DbType.Decimal)); paramCollection.Add(new DBParameter("@BasicAmt", item.BasicAmt, DbType.Decimal)); paramCollection.Add(new DBParameter("@DiscountPercentage", item.DiscountPercentage, DbType.Decimal)); paramCollection.Add(new DBParameter("@DiscountAmount", item.DiscountAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TaxAmount", item.TaxAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@Amount", item.Amount, DbType.Decimal)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); System.Data.IDataReader Idr = _dbHelper.ExecuteDataReader("spInsertSalesVoucherItemDetails", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); } } //Update Sales Bill Sundary foreach (BillSundry_VoucherModel bs in objSales.SalesBillSundry_Voucher) { bs.ParentId = objSales.Trans_Sales_Id; if (bs.BSId > 0) { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Trans_Sales_Id", bs.ParentId)); paramCollection.Add(new DBParameter("@BS_Id", bs.BSId)); paramCollection.Add(new DBParameter("@BSMastID", bs.BS_Id)); paramCollection.Add(new DBParameter("@Percentage", bs.Percentage)); paramCollection.Add(new DBParameter("@Extra", bs.Extra)); paramCollection.Add(new DBParameter("@Amount", bs.Amount)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, DbType.DateTime)); System.Data.IDataReader drbs = _dbHelper.ExecuteDataReader("spUpdateSalesVoucherBS", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); } else { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Trans_Sales_Id", bs.ParentId)); paramCollection.Add(new DBParameter("@BSId", bs.BS_Id)); paramCollection.Add(new DBParameter("@Percentage", bs.Percentage)); paramCollection.Add(new DBParameter("@Extra", bs.Extra)); paramCollection.Add(new DBParameter("@Amount", bs.Amount)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, DbType.DateTime)); System.Data.IDataReader drbs = _dbHelper.ExecuteDataReader("spInsertSalesVoucherBS", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); } } } catch (Exception ex) { isUpdated = false; //throw ex; } return(isUpdated); }
public bool OrderCartDML(OrderCart ic) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", ic.OrderCartId)); paramCollection.Add(new DBParameter("@Tokan", ic.Tokan)); paramCollection.Add(new DBParameter("@CreatedBy", ic.CreatedBy)); paramCollection.Add(new DBParameter("@RequestDetailsId", ic.RequestDetailsId)); paramCollection.Add(new DBParameter("@VendorId", ic.VendorId)); paramCollection.Add(new DBParameter("@Quantity", ic.Quantity)); paramCollection.Add(new DBParameter("@Price", ic.Price)); paramCollection.Add(new DBParameter("@Excise", ic.Excise)); paramCollection.Add(new DBParameter("@Vat", ic.Vat)); paramCollection.Add(new DBParameter("@cst", ic.cst)); paramCollection.Add(new DBParameter("@Insurance", ic.Insurance)); paramCollection.Add(new DBParameter("@Amt", ic.Amt)); paramCollection.Add(new DBParameter("@flag", ic.Flag)); result = _DBHelper.ExecuteNonQuery("SpPrchsOrderCart", paramCollection, CommandType.StoredProcedure); } catch (Exception ex) { string e = ex.ToString(); } if (result > 0) { return(true); } else { return(false); } }
public DataSet GetOrderCartList(OrderCart ic) { DS = new DataSet(); try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", ic.OrderCartId)); paramCollection.Add(new DBParameter("@Tokan", ic.Tokan)); paramCollection.Add(new DBParameter("@CreatedBy", ic.CreatedBy)); paramCollection.Add(new DBParameter("@RequestDetailsId", ic.RequestDetailsId)); paramCollection.Add(new DBParameter("@VendorId", ic.VendorId)); paramCollection.Add(new DBParameter("@Quantity", ic.Quantity)); paramCollection.Add(new DBParameter("@Price", ic.Price)); paramCollection.Add(new DBParameter("@Excise", ic.Excise)); paramCollection.Add(new DBParameter("@Vat", ic.Vat)); paramCollection.Add(new DBParameter("@cst", ic.cst)); paramCollection.Add(new DBParameter("@Insurance", ic.Insurance)); paramCollection.Add(new DBParameter("@Amt", ic.Amt)); paramCollection.Add(new DBParameter("@flag", ic.Flag)); DS = _DBHelper.ExecuteDataSet("SpPrchsOrderCart", paramCollection, CommandType.StoredProcedure); } catch (Exception) { throw; } return(DS); }
public int InsertRoute(Route route) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@routeId", route.RouteID)); paramCollection.Add(new DBParameter("@RouteCode", route.RouteCode)); paramCollection.Add(new DBParameter("@RouteName", route.RouteName)); paramCollection.Add(new DBParameter("@RouteDesc", route.RouteDesc)); paramCollection.Add(new DBParameter("@ASOName", route.ASOID)); paramCollection.Add(new DBParameter("@Discription", route.Discription)); paramCollection.Add(new DBParameter("@IsArchive", route.IsActive)); paramCollection.Add(new DBParameter("@ModifiedBy", route.ModifiedBy)); paramCollection.Add(new DBParameter("@ModifiedDate", route.ModifiedDate)); paramCollection.Add(new DBParameter("@CreatedBy", route.CreatedBy)); paramCollection.Add(new DBParameter("@CreatedDate", route.Createddate)); paramCollection.Add(new DBParameter("@flag", route.flag)); result = _DBHelper.ExecuteNonQuery("Sp_InsertRoute", paramCollection, CommandType.StoredProcedure); } catch (Exception) { } return(result); }
public int ItemRatesDML(ItemRate itemRate) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@ItemRateId", itemRate.ItemRatesId)); paramCollection.Add(new DBParameter("@VendorId", itemRate.VendorId)); paramCollection.Add(new DBParameter("@ItemId", itemRate.ItemId)); paramCollection.Add(new DBParameter("@Quantity", itemRate.Quantity)); paramCollection.Add(new DBParameter("@UnitId", itemRate.UnitId)); paramCollection.Add(new DBParameter("@Price", itemRate.Price)); paramCollection.Add(new DBParameter("@Shipping", itemRate.Shipping)); paramCollection.Add(new DBParameter("@Excise", itemRate.Excise)); paramCollection.Add(new DBParameter("@CST", itemRate.CST)); paramCollection.Add(new DBParameter("@VAT", itemRate.VAT)); paramCollection.Add(new DBParameter("@Insurance", itemRate.Insurance)); paramCollection.Add(new DBParameter("@Freight", itemRate.Freight)); paramCollection.Add(new DBParameter("@TotalPrice", itemRate.TotalPrice)); paramCollection.Add(new DBParameter("@Flag", itemRate.Flag)); result = _DBHelper.ExecuteNonQuery("SpPrchsItemRatesDML", paramCollection, CommandType.StoredProcedure); } catch (Exception ex) { } return(result); }
//SAVE PURCHASE Quotation public bool SavePurchaseQuotation(PurchaseVoucherMainModel objPurcQuotation) { string Query = string.Empty; bool isSaved = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@VoucherNumber", objPurcQuotation.PurchaseVoucher_Number)); paramCollection.Add(new DBParameter("@Series", objPurcQuotation.PurchaseVoucher_Series)); paramCollection.Add(new DBParameter("@PurcDate", objPurcQuotation.PurchaseVoucher_Date, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@PurcType", objPurcQuotation.PurchaseVoucher_PurchaseType)); paramCollection.Add(new DBParameter("@Party", objPurcQuotation.PurchaseVoucher_Party)); paramCollection.Add(new DBParameter("@MatCentre", objPurcQuotation.PurchaseVoucher_MatCenter)); paramCollection.Add(new DBParameter("@Narration", objPurcQuotation.Narration)); paramCollection.Add(new DBParameter("@ItemTotalAmount", objPurcQuotation.TotalAmount)); paramCollection.Add(new DBParameter("@ItemTotalQty", objPurcQuotation.TotalQty)); paramCollection.Add(new DBParameter("@BSTotalAmount", objPurcQuotation.BSTotalAmount)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); System.Data.IDataReader dr = _dbHelper.ExecuteDataReader("spInsertPurchaseQuotationMaster", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); int id = 0; dr.Read(); id = Convert.ToInt32(dr[0]); SavePurchaseQuotationItems(objPurcQuotation.PurchaseItem_Voucher, id); SavePurchaseQuotationBillSundry(objPurcQuotation.BillSundry_Voucher, id); } catch (Exception ex) { isSaved = false; throw ex; } return(isSaved); }
public bool UpdatePurchaseVoucherItems(Item_VoucherModel objPVItem) { string Query = string.Empty; bool isUpdated = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Purchase_Item", objPVItem.Item)); paramCollection.Add(new DBParameter("@Purchase_batch", objPVItem.Batch)); paramCollection.Add(new DBParameter("@Purchase_Qty", objPVItem.Qty, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@Purchase_Unit", objPVItem.Unit)); paramCollection.Add(new DBParameter("@Purchase_Price", objPVItem.Price, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@Purchase_Amount", objPVItem.Amount, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalQty", objPVItem.TotalQty, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalAmount", objPVItem.TotalAmount, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@ModifiedBy", objPVItem.ModifiedBy)); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now)); paramCollection.Add(new DBParameter("@PurchaseId", objPVItem.ParentId)); paramCollection.Add(new DBParameter("@ItemId", objPVItem.Item_ID)); Query = "UPDATE Trans_PV_Items SET [Item]=@Purchase_Item,[Batch]=@Purchase_batch,[Qty]=@Purchase_Qty,[Unit]=@Purchase_Unit," + "[Price]=@Purchase_Price,[Amount]=@Purchase_Amount,[TotalQty]=@TotalQty,[TotalAmount]=@TotalAmount,[ModifiedBy]=@ModifiedBy,[ModifiedDate]=@ModifiedDate " + "WHERE transPVId=@PurchaseId AND [ItemId]=@ItemId"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { isUpdated = true; } } catch (Exception ex) { isUpdated = false; throw ex; } return(isUpdated); }
public int InsertAgentInfo(AgentInfo agentinfo) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@AgentID", agentinfo.AgentID)); paramCollection.Add(new DBParameter("@AgentCode", agentinfo.AgentCode)); paramCollection.Add(new DBParameter("@RouteID", agentinfo.RouteID)); paramCollection.Add(new DBParameter("@AgentName", agentinfo.AgentName)); paramCollection.Add(new DBParameter("@DateofJoining", agentinfo.DateofJoining)); paramCollection.Add(new DBParameter("@AppriveBy", agentinfo.AppriveBy)); paramCollection.Add(new DBParameter("@Isactive", agentinfo.Status)); paramCollection.Add(new DBParameter("@Agensytype", agentinfo.Agensytype)); paramCollection.Add(new DBParameter("@Address1", agentinfo.Address1)); paramCollection.Add(new DBParameter("@Address2", agentinfo.Address2)); paramCollection.Add(new DBParameter("@Address3", agentinfo.Address3)); paramCollection.Add(new DBParameter("@Email", agentinfo.Email)); paramCollection.Add(new DBParameter("@TelephoneNo", agentinfo.TelephoneNo)); paramCollection.Add(new DBParameter("@MobileNo", agentinfo.MobileNo)); paramCollection.Add(new DBParameter("@City", agentinfo.City)); paramCollection.Add(new DBParameter("@Districk", agentinfo.Districk)); paramCollection.Add(new DBParameter("@State", agentinfo.State)); paramCollection.Add(new DBParameter("@Country", agentinfo.Country)); paramCollection.Add(new DBParameter("@BillingMethod", agentinfo.BillingMethod)); paramCollection.Add(new DBParameter("@PaymentMode", agentinfo.PaymentType)); paramCollection.Add(new DBParameter("@DepositeAmount", agentinfo.DepositAmount)); paramCollection.Add(new DBParameter("@Bankname", agentinfo.BankName)); paramCollection.Add(new DBParameter("@AccountNo", agentinfo.AccounNo)); paramCollection.Add(new DBParameter("@AccountType", agentinfo.AccountType)); paramCollection.Add(new DBParameter("@IFScode", agentinfo.IFSCCode)); paramCollection.Add(new DBParameter("@Volume", agentinfo.Volume)); paramCollection.Add(new DBParameter("@NoTrays", agentinfo.NoofTrays)); paramCollection.Add(new DBParameter("@DoorToDoor", agentinfo.DoortoDoor)); paramCollection.Add(new DBParameter("@FreezerAvailable", agentinfo.FreezerAvailable)); paramCollection.Add(new DBParameter("@FreezerRetruns", agentinfo.FreezerRestrun)); paramCollection.Add(new DBParameter("@Deactivedate", agentinfo.Deactivedate)); paramCollection.Add(new DBParameter("@DeactiveReason", agentinfo.DeactiveReason)); paramCollection.Add(new DBParameter("@AmountReturned", agentinfo.AmountReturned)); paramCollection.Add(new DBParameter("@AsoId", agentinfo.ASOID)); paramCollection.Add(new DBParameter("@TraysReturned", agentinfo.TraysReturned)); paramCollection.Add(new DBParameter("@IsArchive", agentinfo.IsArchive)); paramCollection.Add(new DBParameter("@SchemeAmount", agentinfo.SchemeAmount)); paramCollection.Add(new DBParameter("@TotalSchemeAmount", agentinfo.SchemeTotalAmount)); paramCollection.Add(new DBParameter("@CreatedBy", agentinfo.CreatedBy)); paramCollection.Add(new DBParameter("@Createddate", agentinfo.Createddate)); paramCollection.Add(new DBParameter("@ModifiedBy", agentinfo.ModifiedBy)); paramCollection.Add(new DBParameter("@ModifiedDate", agentinfo.ModifiedDate)); paramCollection.Add(new DBParameter("@flag", agentinfo.flag)); result = _DBHelper.ExecuteNonQuery("Sp_InsertAgentInfo", paramCollection, CommandType.StoredProcedure); //result = _DBHelper.ExecuteNonQuery("test1", paramCollection, CommandType.StoredProcedure); } catch (SqlException ex) { // Comman.Comman.msg = ex.ToString(); if (ex.Message.Contains("UNIQUE KEY constraint")) { Comman.Comman.msg = "DUPLICATE AGENT CODE : Agent Code Should be Unique"; } } return(result); }
public int personalhygieneqcdata(MPersonalHygieneCheckListQC receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("PersonalHygieneCheckListQCId", receive.PersonalHygieneCheckListQCId)); paramcollection.Add(new DBParameter("PersonalHygieneCheckListQCDate", receive.PersonalHygieneCheckListQCDate)); paramcollection.Add(new DBParameter("EmployeeId", receive.EmployeeId)); paramcollection.Add(new DBParameter("DesignationId", receive.DesignationId)); paramcollection.Add(new DBParameter("UniformCleaning", receive.UniformCleaning)); paramcollection.Add(new DBParameter("Nail", receive.Nail)); paramcollection.Add(new DBParameter("Cap", receive.Cap)); paramcollection.Add(new DBParameter("ApronLab", receive.ApronLab)); paramcollection.Add(new DBParameter("BeardCrimp", receive.BeardCrimp)); paramcollection.Add(new DBParameter("HandGloves", receive.HandGloves)); paramcollection.Add(new DBParameter("Mask", receive.Mask)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_PersonalHygieneCheckListQCDetails", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { string MSG = EX.ToString(); } return(result); }
public bool MrnDML(MRNDetails ic) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", ic.Id)); paramCollection.Add(new DBParameter("@ItemId", ic.ItemId)); paramCollection.Add(new DBParameter("@OrderDetailsId", ic.OrderDetailsId)); paramCollection.Add(new DBParameter("@OrderedQty", ic.OrderedQty)); paramCollection.Add(new DBParameter("@ReceivedQty", ic.ReceivedQty)); paramCollection.Add(new DBParameter("@AcceptedQty", ic.AcceptedQty)); paramCollection.Add(new DBParameter("@RejectedQty", ic.RejectedQty)); paramCollection.Add(new DBParameter("@Price", ic.Price)); paramCollection.Add(new DBParameter("@Excise", ic.Excise)); paramCollection.Add(new DBParameter("@Cst", ic.Cst)); paramCollection.Add(new DBParameter("@Vat", ic.Vat)); paramCollection.Add(new DBParameter("@Amount", ic.Amount)); paramCollection.Add(new DBParameter("@flag", ic.Flag)); result = _DBHelper.ExecuteNonQuery("SpPrchsMrnDML", paramCollection, CommandType.StoredProcedure); } catch (Exception ex) { string e = ex.ToString(); } if (result > 0) { return(true); } else { return(false); } }
//UPDATE Physical Stock Voucher public bool UpdatePhysicalStock(PhysicalStockModel objphysical) { string Query = string.Empty; bool isUpdated = true; try { //UPDATE CREDIT NOTE TABLE - PARENT TABLE DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@VoucherNo", objphysical.Voucher_Number)); paramCollection.Add(new DBParameter("@Date", objphysical.PSDate, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@Matcenter", objphysical.MatCenter)); paramCollection.Add(new DBParameter("@Narration", objphysical.Narration)); paramCollection.Add(new DBParameter("@Series", objphysical.SVSeries)); paramCollection.Add(new DBParameter("@JournalVoucher", objphysical.StockJournalVoucher, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@InputSub", objphysical.InputSubDetails, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@ScannBarCode", objphysical.ScannBarcode, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@UpdateVoucher", objphysical.UpdateVoucher, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@Items", objphysical.Items, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@BSN", objphysical.BCN, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@SerialNo", objphysical.SerialNo, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@Batch", objphysical.Batch, System.Data.DbType.Boolean)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@id", objphysical.Phycial_Id)); Query = "UPDATE Physical_Stock_Voucher SET [VoucherNo]=@VoucherNo,[Physical_Date]=@Date,[MatCenter]=@Matcenter," + "[Narration]=@Narration,[Journal Series]=@Series,[Journal Voucher]=@JournalVoucher,[Input Sub]=@InputSub,[Scann Barcode]=@ScannBarCode," + "[Update Journal Narration]=@UpdateVoucher,[Items]=@Items,[BCN]=@BSN,[SerialNo]=@SerialNo,[Batch]=@Batch,[CreatedBy]=@CreatedBy " + "WHERE Physical_Id=@id"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { List <StockItemsModel> lstAcct = new List <StockItemsModel>(); //UPDATE CREDIT NOTE ACCOUNT -CHILD TABLE UPDATES foreach (StockItemsModel stock in objphysical.StockItemsModel) { if (stock.item_Id > 0) { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Item", (stock.item))); paramCollection.Add(new DBParameter("@Pstock", stock.Pstock)); paramCollection.Add(new DBParameter("@Bstock", stock.Bstock)); paramCollection.Add(new DBParameter("@Difference", stock.Difference)); paramCollection.Add(new DBParameter("@ModifiedBy", "Admin")); paramCollection.Add(new DBParameter("@Item_ID", (stock.item_Id))); Query = "UPDATE Physical_Stock_Items SET [Item]=@Item,[Physical Stock]=@Pstock,[Book Stock]=@Bstock,[Difference]=@Difference,[ModifiedBy]=@ModifiedBy " + "WHERE [Item_Id]=Item_ID"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { isUpdated = true; } } else { paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@PS_ID", (objphysical.Phycial_Id))); paramCollection.Add(new DBParameter("@Item", (stock.item))); paramCollection.Add(new DBParameter("@Pstock", stock.Pstock)); paramCollection.Add(new DBParameter("@Bstock", stock.Bstock)); paramCollection.Add(new DBParameter("@Difference", stock.Difference)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); //paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now)); Query = "INSERT INTO Physical_Stock_Items ([Physical_Id],[Item],[Physical Stock],[Book Stock],[Difference],[CreatedBy])" + " VALUES " + "(@PS_ID,@Item,@Pstock,@Bstock,@Difference,@CreatedBy)"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { } ; } } } } catch (Exception ex) { isUpdated = false; throw ex; } return(isUpdated); }
public bool MrnDML2(MRN ic) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@CreatedBy", ic.CreatedBy)); paramCollection.Add(new DBParameter("@VendorId", ic.VendorId)); paramCollection.Add(new DBParameter("@PRNo", ic.PRNo)); paramCollection.Add(new DBParameter("@OrderId", ic.OrderId)); paramCollection.Add(new DBParameter("@BillNo", ic.BillNo)); paramCollection.Add(new DBParameter("@BillDate", ic.BillDate)); paramCollection.Add(new DBParameter("@RequiredFor", ic.RequiredFor)); paramCollection.Add(new DBParameter("@Remarks", ic.Remarks)); paramCollection.Add(new DBParameter("@ReceivedBy", ic.ReceivedBy)); paramCollection.Add(new DBParameter("@QCBy", ic.QCBy)); paramCollection.Add(new DBParameter("@FinMgr", ic.FinMgr)); paramCollection.Add(new DBParameter("@ApprovedByEmpId", ic.ApprovedBy)); paramCollection.Add(new DBParameter("@VehicleNo", ic.VehicleNo)); paramCollection.Add(new DBParameter("@TotalAmt", ic.TotalAmt)); result = _DBHelper.ExecuteNonQuery("SpPrchsMrnDML2", paramCollection, CommandType.StoredProcedure); } catch (Exception ex) { string e = ex.ToString(); } if (result > 0) { return(true); } else { return(false); } }
public bool SaveSalesVoucher(TransSalesModel objSales) { string Query = string.Empty; bool isSaved = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@VoucherType", objSales.VoucherType)); paramCollection.Add(new DBParameter("@SaleDate", objSales.SaleDate, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@Terms", objSales.Terms)); paramCollection.Add(new DBParameter("@VoucherNumber", objSales.VoucherNumber)); paramCollection.Add(new DBParameter("@BillNumber", objSales.BillNo)); paramCollection.Add(new DBParameter("@LedgerId", objSales.LedgerId)); paramCollection.Add(new DBParameter("@SalesType", objSales.SalesType)); paramCollection.Add(new DBParameter("@MatCentre", objSales.MatCentre)); paramCollection.Add(new DBParameter("@Narration", objSales.Narration)); paramCollection.Add(new DBParameter("@TotalAmount", objSales.TotalAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalQty", objSales.TotalQty, DbType.Decimal)); paramCollection.Add(new DBParameter("@BSTotalAmount", objSales.BSTotalAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalFree", objSales.TotalFree, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalBasicAmount", objSales.TotalBasicAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalDisAmount", objSales.TotalDisAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TotalTaxAmount", objSales.TotalTaxAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@PriceList", objSales.PriceList)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, DbType.DateTime)); System.Data.IDataReader dr = _dbHelper.ExecuteDataReader("spInsertSalesVoucherMaster", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); int id = 0; dr.Read(); id = Convert.ToInt32(dr[0]); SaveSalesVoucherItems(objSales.SalesItem_Voucher, id); SaveSalesBillSundryVoucher(objSales.SalesBillSundry_Voucher, id); } catch (Exception ex) { isSaved = false; throw ex; } return(isSaved); }
public DataSet GetVendorsList(Vendor vendor) { DS = new DataSet(); try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", vendor.VendorId)); paramCollection.Add(new DBParameter("@Vendorname", vendor.VendorName)); paramCollection.Add(new DBParameter("@VendorCode", vendor.VendorCode)); paramCollection.Add(new DBParameter("@Address", vendor.Address)); paramCollection.Add(new DBParameter("@City", vendor.City)); paramCollection.Add(new DBParameter("@State", vendor.State)); paramCollection.Add(new DBParameter("@Mobile", vendor.Mobile)); paramCollection.Add(new DBParameter("@Phone", vendor.Phone)); paramCollection.Add(new DBParameter("@Email", vendor.Email)); paramCollection.Add(new DBParameter("@IsActive", vendor.IsActive)); paramCollection.Add(new DBParameter("@flag", vendor.Flag)); DS = _DBHelper.ExecuteDataSet("SpPrchsVendorsDML", paramCollection, CommandType.StoredProcedure); } catch (Exception) { throw; } return(DS); }
//Save Sales Voucher Items Details public bool SaveSalesVoucherItems(List <Item_VoucherModel> lstSales, int ParentId) { string Query = string.Empty; bool isSaved = true; foreach (Item_VoucherModel item in lstSales) { item.ParentId = ParentId; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Trans_Sales_Id", item.ParentId)); paramCollection.Add(new DBParameter("@ItemId", item.ITM_Id)); paramCollection.Add(new DBParameter("@LedgerId", item.LedgerId)); paramCollection.Add(new DBParameter("@Qty", item.Qty, DbType.Decimal)); paramCollection.Add(new DBParameter("@Unit", item.Unit)); paramCollection.Add(new DBParameter("@Per", item.Per)); paramCollection.Add(new DBParameter("@Price", item.Price, DbType.Decimal)); paramCollection.Add(new DBParameter("@Batch", item.Batch)); paramCollection.Add(new DBParameter("@Free", item.Free, DbType.Decimal)); paramCollection.Add(new DBParameter("@BasicAmt", item.BasicAmt, DbType.Decimal)); paramCollection.Add(new DBParameter("@DiscountPercentage", item.DiscountPercentage, DbType.Decimal)); paramCollection.Add(new DBParameter("@DiscountAmount", item.DiscountAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@TaxAmount", item.TaxAmount, DbType.Decimal)); paramCollection.Add(new DBParameter("@Amount", item.Amount, DbType.Decimal)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); System.Data.IDataReader dr = _dbHelper.ExecuteDataReader("spInsertSalesVoucherItemDetails", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); } catch (Exception ex) { isSaved = false; throw ex; } } return(isSaved); }
public int VendorDML(Vendor vendor) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", vendor.VendorId)); paramCollection.Add(new DBParameter("@Vendorname", vendor.VendorName)); paramCollection.Add(new DBParameter("@VendorCode", vendor.VendorCode)); paramCollection.Add(new DBParameter("@Address", vendor.Address)); paramCollection.Add(new DBParameter("@City", vendor.City)); paramCollection.Add(new DBParameter("@State", vendor.State)); paramCollection.Add(new DBParameter("@Mobile", vendor.Mobile)); paramCollection.Add(new DBParameter("@Phone", vendor.Phone)); paramCollection.Add(new DBParameter("@Email", vendor.Email)); paramCollection.Add(new DBParameter("@IsActive", vendor.IsActive)); paramCollection.Add(new DBParameter("@flag", vendor.Flag)); result = _DBHelper.ExecuteNonQuery("SpPrchsVendorsDML", paramCollection, CommandType.StoredProcedure); } catch (Exception ex) { } return(result); }
public bool SaveJVAccounts(List <AccountModel> lstAcc, int ParentId) { string Query = string.Empty; bool isSaved = true; foreach (AccountModel Acc in lstAcc) { Acc.ParentId = ParentId; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@JournalId", (Acc.ParentId))); paramCollection.Add(new DBParameter("@DC", (Acc.DC))); paramCollection.Add(new DBParameter("@Account", Acc.Account)); paramCollection.Add(new DBParameter("@LegderId", Acc.LedgerId)); paramCollection.Add(new DBParameter("@DebitAmount", Acc.Debit, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@CreditAmount", Acc.Credit, System.Data.DbType.Decimal)); paramCollection.Add(new DBParameter("@Narration", Acc.Narration)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime)); paramCollection.Add(new DBParameter("@ModifiedBy", "")); paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime)); System.Data.IDataReader dr = _dbHelper.ExecuteDataReader("spInsertJournalDetails", _dbHelper.GetConnObject(), paramCollection, System.Data.CommandType.StoredProcedure); } catch (Exception ex) { isSaved = false; throw ex; } } return(isSaved); }
public int AddDispatchInfo(Dispatch dispatch) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@DI_Id", dispatch.DispatchId)); paramCollection.Add(new DBParameter("@DI_SalesmanFirstId", dispatch.SalesmanFirstId)); paramCollection.Add(new DBParameter("@DI_SalesmanSecondId", dispatch.SalesmanSecondId)); paramCollection.Add(new DBParameter("@DI_RouteId", dispatch.RouteID)); paramCollection.Add(new DBParameter("@DI_DriverFirstId", dispatch.DriverFirstId)); paramCollection.Add(new DBParameter("@DI_DriverSecondId", dispatch.DriverSecondId)); paramCollection.Add(new DBParameter("@DI_VehicleId", dispatch.VehicleId)); paramCollection.Add(new DBParameter("@TraysDispached", dispatch.Trays)); paramCollection.Add(new DBParameter("@IceBoxDispached", dispatch.IceBox)); paramCollection.Add(new DBParameter("@CartonsDispached", dispatch.Cartons)); paramCollection.Add(new DBParameter("@OtherDispached", dispatch.OtherDisp)); paramCollection.Add(new DBParameter("@DispatchDate", dispatch.DispatchDate)); paramCollection.Add(new DBParameter("@DispatchBy", dispatch.UserID)); paramCollection.Add(new DBParameter("@BrandId", dispatch.CategoryId)); //paramCollection.Add(new DBParameter("@DispatchDateTime", dispatch.DispatchDateTime)); result = _DBHelper.ExecuteNonQuery("Sp_AddDispatchInfo", paramCollection, CommandType.StoredProcedure); } catch (Exception) { } return(result); }
public int AfterProcessingQcData(MQCAfterProcessing receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("@RMRId", receive.RMRId)); paramcollection.Add(new DBParameter("@BatchCode", receive.BatchCode)); paramcollection.Add(new DBParameter("@APQCDate", receive.APQCDate)); paramcollection.Add(new DBParameter("@APQCShiftId", receive.APQCShiftId)); paramcollection.Add(new DBParameter("@ProcessingTime", receive.ProcessingTime)); paramcollection.Add(new DBParameter("@SiloNo", receive.SiloNo)); paramcollection.Add(new DBParameter("@ProcessedQty", receive.ProcessedQty)); paramcollection.Add(new DBParameter("@ProcessTemperature", receive.ProcessTemperature)); paramcollection.Add(new DBParameter("@OrganoSmell", receive.OrganoSmell)); paramcollection.Add(new DBParameter("@OrganoTaste", receive.OrganoTaste)); paramcollection.Add(new DBParameter("@OrganoColor", receive.OrganoColor)); paramcollection.Add(new DBParameter("@Acidity", receive.Acidity)); paramcollection.Add(new DBParameter("@PhosStartTime", receive.PhosStartTime)); paramcollection.Add(new DBParameter("@PhosEndTime", receive.PhosEndTime)); paramcollection.Add(new DBParameter("@PhosTotalHrs", receive.PhosTotalHrs)); paramcollection.Add(new DBParameter("@MBRTStartTime", receive.MBRTStartTime)); paramcollection.Add(new DBParameter("@MBRTEndTime", receive.MBRTEndTime)); paramcollection.Add(new DBParameter("@MBRTTotalHrs", receive.MBRTTotalHrs)); paramcollection.Add(new DBParameter("@Fat", receive.Fat)); paramcollection.Add(new DBParameter("@CLR", receive.CLR)); paramcollection.Add(new DBParameter("@SNF", receive.SNF)); paramcollection.Add(new DBParameter("@HomEfficiency", receive.HomEfficiency)); paramcollection.Add(new DBParameter("@AfterProcessingStatusId", receive.AfterProcessingStatusId)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_QCAfterProcessingDetails", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { string MSG = EX.ToString(); } return(result); }
public bool UpdateTransportInfo(Dispatch dispatch) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@TM_Id", dispatch.TM_Id)); paramCollection.Add(new DBParameter("@VehicleNo", dispatch.VehicleNo)); paramCollection.Add(new DBParameter("@VehicleBrand", dispatch.VehicleBrand)); paramCollection.Add(new DBParameter("@Veh_Model", dispatch.Veh_Model)); paramCollection.Add(new DBParameter("@Veh_Year", dispatch.Veh_Year)); paramCollection.Add(new DBParameter("@Veh_Type", dispatch.Veh_Type)); paramCollection.Add(new DBParameter("@Veh_Reg", dispatch.Veh_Reg)); paramCollection.Add(new DBParameter("@Veh_ChassisNo ", dispatch.Veh_ChassisNo)); paramCollection.Add(new DBParameter("@Veh_EngineNo", dispatch.Veh_EngineNo)); paramCollection.Add(new DBParameter("@Veh_InsProvider", dispatch.Veh_InsProvider)); paramCollection.Add(new DBParameter("@Veh_InsPolicyNo", dispatch.Veh_InsPolicyNo)); paramCollection.Add(new DBParameter("@Veh_InsStart", dispatch.Veh_InsStart)); paramCollection.Add(new DBParameter("@Veh_InsLast", dispatch.Veh_InsLast)); paramCollection.Add(new DBParameter("@Veh_InsAmount", dispatch.Veh_InsAmount)); paramCollection.Add(new DBParameter("@Veh_OwnershipType", dispatch.Veh_OwnershipType)); paramCollection.Add(new DBParameter("@Veh_OwnerName", dispatch.Veh_OwnerName)); paramCollection.Add(new DBParameter("@Veh_ContactNo", dispatch.Veh_ContactNo)); paramCollection.Add(new DBParameter("@Veh_OwnerAddress", dispatch.Veh_OwnerAddress)); paramCollection.Add(new DBParameter("@Veh_FuelType", dispatch.Veh_FuelType)); paramCollection.Add(new DBParameter("@BankId", dispatch.BankId)); paramCollection.Add(new DBParameter("@BankAc", dispatch.BankAc)); paramCollection.Add(new DBParameter("@Veh_Status", dispatch.IsActive)); paramCollection.Add(new DBParameter("@Veh_CreateUser", dispatch.CreatedBy)); paramCollection.Add(new DBParameter("@Veh_CreateUserDate", dispatch.Createddate)); //paramCollection.Add(new DBParameter("@Flag", product.flag)); result = _DBHelper.ExecuteNonQuery("Sp_UpdateTransportDetails", paramCollection, CommandType.StoredProcedure); //result = _DBHelper.ExecuteNonQuery("Sp_AddBankDetails", paramCollection, CommandType.StoredProcedure); } catch (Exception) { } if (result > 0) { return(true); } return(false); }
public int PasteurizationData(MPasteurizationQC receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("@PastQCId", receive.PastQCId)); paramcollection.Add(new DBParameter("@PastProcessId", receive.PastProcessId)); paramcollection.Add(new DBParameter("@StdId", receive.StdId)); paramcollection.Add(new DBParameter("@QualityId", receive.QualityId)); paramcollection.Add(new DBParameter("@RMRId", receive.RMRId)); paramcollection.Add(new DBParameter("@PastQCDate", receive.PastQCDate)); paramcollection.Add(new DBParameter("@PastQCShiftId", receive.PastQCShiftId)); paramcollection.Add(new DBParameter("@TemperatureHeat", receive.TemperatureHeat)); paramcollection.Add(new DBParameter("@TempChill", receive.TempChill)); paramcollection.Add(new DBParameter("@DoneBy", receive.DoneBy)); paramcollection.Add(new DBParameter("@Remarks", receive.Remarks)); paramcollection.Add(new DBParameter("@QCStatus", receive.QCStatus)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_PasteurizationQCDetails", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { string MSG = EX.ToString(); } return(result); }
public int AgencyCloserbyAgentID(Dispatch d) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@AgentID", d.AgentID)); paramCollection.Add(new DBParameter("@comment", d.comment)); paramCollection.Add(new DBParameter("@closedby", d.closedby)); paramCollection.Add(new DBParameter("@loanpaid", d.loanpaid)); paramCollection.Add(new DBParameter("@shemepaid", d.shemepaid)); paramCollection.Add(new DBParameter("@incentivepaid", d.incentivepaid)); paramCollection.Add(new DBParameter("@depositrefund", d.depositrefund)); paramCollection.Add(new DBParameter("@freezerreturn", d.freezerreturn)); paramCollection.Add(new DBParameter("@Chillpad", d.Chillpad)); paramCollection.Add(new DBParameter("@Trays", d.Traysreturn)); paramCollection.Add(new DBParameter("@tokanid", d.tokanid)); result = _DBHelper.ExecuteNonQuery("Sp_AgencyCloserbyAgentID", paramCollection, CommandType.StoredProcedure); } catch (Exception) { } return(result); }
public bool SaveUnassembleVoucher(UnassembleVoucherModel objAssemble) { string Query = string.Empty; bool isSaved = true; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Series", objAssemble.Series)); paramCollection.Add(new DBParameter("@AssembleDate", objAssemble.UA_Date)); paramCollection.Add(new DBParameter("@VoucherNumber", objAssemble.Voucher_Number)); paramCollection.Add(new DBParameter("@MatCenter1", objAssemble.MatCenter1)); paramCollection.Add(new DBParameter("@MatCenter2", objAssemble.MatCenter2)); paramCollection.Add(new DBParameter("@Narration", objAssemble.Narration)); paramCollection.Add(new DBParameter("@TotalQty", objAssemble.TotalQty)); paramCollection.Add(new DBParameter("@TotalAmount", objAssemble.TotalAmount)); paramCollection.Add(new DBParameter("@BSTotalAmount", objAssemble.BSTotalAmount)); paramCollection.Add(new DBParameter("@CreatedBy", "Admin")); paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now)); Query = "INSERT INTO Trans_Unassemble_Voucher ([Series],[UA_Date],[VoucherNo],[MatCenter1]," + "[MatCenter2],[Narration],[TotalQty],[TotalAmount],[BSTotalAmount],[CreatedBy],[CreatedDate]) VALUES " + "(@Series,@AssembleDate,@VoucherNumber,@MatCenter1,@MatCenter2,@Narration,@TotalQty,@TotalAmount,@BSTotalAmount,@CreatedBy,@CreatedDate)"; if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0) { SaveUnassembleItems(objAssemble.AssembleItem_Voucher); SaveUnassembleBillSundry(objAssemble.AssembleBillSundry_Voucher); isSaved = true; } } catch (Exception ex) { isSaved = false; throw ex; } return(isSaved); }
/// <summary> /// Save Contact Master /// </summary> /// <param name="objconmaster"></param> /// <returns>True/False</returns> public bool Savecontactmaster(eSunSpeedDomain.ContactmasterModel objconmaster) { string Query = string.Empty; int connectwithledger = 0; int specifydob = 0; int specifydateofanniversary = 0; if (objconmaster.Connectwithledger) { connectwithledger = 1; } if (objconmaster.SpecifyDateofAnniversary) { specifydateofanniversary = 1; } if (objconmaster.SpecifyDateofBirth) { specifydob = 1; } DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Name", objconmaster.Name)); paramCollection.Add(new DBParameter("@Alias", objconmaster.AliasName)); paramCollection.Add(new DBParameter("@PrintName", objconmaster.PrintName)); // paramCollection.Add(new DBParameter("@Primary", objconmaster.Primary)); paramCollection.Add(new DBParameter("@Connectwithledger", connectwithledger)); paramCollection.Add(new DBParameter("@Organisation", objconmaster.Organisation)); paramCollection.Add(new DBParameter("@MobileNo", objconmaster.MobileNo)); paramCollection.Add(new DBParameter("@Email", objconmaster.Email)); paramCollection.Add(new DBParameter("@TypeofTrade", objconmaster.TypeofTrade)); paramCollection.Add(new DBParameter("@Group", objconmaster.Group)); paramCollection.Add(new DBParameter("@Area", objconmaster.Area)); paramCollection.Add(new DBParameter("@Department", objconmaster.Department)); paramCollection.Add(new DBParameter("@SpecifyDateofBirth", specifydob)); paramCollection.Add(new DBParameter("@SpecifyDateofAnniversary", specifydateofanniversary)); paramCollection.Add(new DBParameter("@CreatedBy", objconmaster.CreatedBy)); paramCollection.Add(new DBParameter("@Address", objconmaster.Address)); paramCollection.Add(new DBParameter("@Address1", objconmaster.Address1)); paramCollection.Add(new DBParameter("@Address2", objconmaster.Address2)); paramCollection.Add(new DBParameter("@Address3", objconmaster.Address3)); paramCollection.Add(new DBParameter("@PhoneNo", objconmaster.PhoneNo)); paramCollection.Add(new DBParameter("@AFaxNo", objconmaster.FaxNo)); Query = "INSERT INTO CONTACTMASTER (`Name`,`Alias`,`PrintName`,`Connectwithledger`,`Organisation`,`MobileNo`,`Email`,`TypeofTrade`,`Group`," + "`Area`,`Department`,`SpecifyDateofBirth`,`SpecifyDateofAnniversary`,`Address`,`Address1`,`Address2`,`Address3`,`PhoneNo`,`FaxNo`) " + "VALUES (@Name,@Alias,@PrintName,@Connectwithledger,@Organisation,@MobileNo,@Email,@TypeofTrade,@Group,@Area,@Department,@SpecifyDateofBirth," + "@SpecifyDateofAnniversary,@Address,@Address1,@Address2,@Address3,@PhoneNo,@FaxNo)"; return(_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0); }