public GRNBasicProductsCollec Get() { try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_GRNBasicProduct"); GRNBasicProductsCollec objGRNBasicProductsCollec = new GRNBasicProductsCollec(); for (int i = 0; i < dt.Rows.Count; i++) { GRNBasicProducts objGRNBasicProduct = new GRNBasicProducts(); objGRNBasicProduct.BasicProduct = objBasicProduct_DL.Get(Convert.ToString(dt.Rows[i]["BasicProductCode"])); objGRNBasicProduct.GRN = objGRN_DL.Get(Convert.ToInt64(dt.Rows[i]["GRNNO"])); objGRNBasicProduct.GrossQty = Convert.ToDecimal(dt.Rows[i]["GrossQty"]); objGRNBasicProduct.NetQty = Convert.ToDecimal(dt.Rows[i]["NetQty"]); objGRNBasicProduct.Remarks = Convert.ToString(dt.Rows[i]["Remarks"]); objGRNBasicProduct.UnitPrice = Convert.ToDecimal(dt.Rows[i]["UnitPrice"]); objGRNBasicProductsCollec.Add(objGRNBasicProduct); } return(objGRNBasicProductsCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public FormulaBasicProduct Get(long FormulaID, String BasicProductCode, String FormulaPart) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@FormulaID", FormulaID), new SqlParameter("@FormulaBasicProductCode", BasicProductCode), new SqlParameter("@FormulaPart", FormulaPart) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_FormulaBasicProductByID", paramList); FormulaBasicProduct objFormulaBasicProduct = new FormulaBasicProduct(); for (int i = 0; i < dt.Rows.Count; i++) { objFormulaBasicProduct.BasicProduct = objBasicProduct_DL.Get(Convert.ToString(dt.Rows[0]["FormulaBasicProductCode"])); objFormulaBasicProduct.Formula = objFormula_DL.Get(Convert.ToInt32(dt.Rows[0]["FormulaID"])); objFormulaBasicProduct.FormulaPart = Convert.ToString(dt.Rows[0]["FormulaPart"]); objFormulaBasicProduct.FormulaProductQty = Convert.ToDecimal(dt.Rows[0]["FormulaProductQty"]); } return(objFormulaBasicProduct); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MRBasicProductCollec Get() { try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MRBasicProduct"); MRBasicProductCollec objMRBasicCollec = new MRBasicProductCollec(); for (int i = 0; i < dt.Rows.Count; i++) { MRBasicProduct objMRBasicProduct = new MRBasicProduct(); objMRBasicProduct.BasicProduct = objBasicProduct_DL.Get(Convert.ToString(dt.Rows[i]["MRBasicProductID"])); objMRBasicProduct.Description = Convert.ToString(dt.Rows[i]["MRDescription"]); objMRBasicProduct.MR = objMR_DL.Get(Convert.ToInt64(dt.Rows[i]["MRNO"])); objMRBasicProduct.MRBINNo = Convert.ToString(dt.Rows[i]["MRBINNo"]); objMRBasicProduct.ReqdQty = Convert.ToDecimal(dt.Rows[i]["MRReqdQty"]); objMRBasicProduct.IssuedQty = Convert.ToDecimal(dt.Rows[i]["MRIssuedQty"]); if (dt.Rows[i]["MRUnitRate"] != null) { objMRBasicProduct.UniRate = Convert.ToDecimal(dt.Rows[i]["MRUnitRate"]); } else { objMRBasicProduct.UniRate = 0; } objMRBasicCollec.Add(objMRBasicProduct); } return(objMRBasicCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public FinishProductCollec Get() { try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_FinishProduct_DataView"); FinishProductCollec objCollec = new FinishProductCollec(); for (int i = 0; i < dt.Rows.Count; i++) { FinishProduct objFinishProduct = new FinishProduct(); objFinishProduct.BasicProduct = objBasicProduct_DL.Get(Convert.ToString(dt.Rows[i]["BasicProductCode"])); objFinishProduct.BasicProductQty = Convert.ToDecimal(dt.Rows[i]["FinishProdutBasicQty"]); objFinishProduct.FinishProductAvgCost = Convert.ToDecimal(dt.Rows[i]["FinishProdutAvgCost"]); objFinishProduct.FinishProductCode = Convert.ToString(dt.Rows[i]["FinishProductCode"]); objFinishProduct.FinishProductDescription = Convert.ToString(dt.Rows[i]["FinishProductDescription"]); objFinishProduct.FinishProductFormula = objFormula_DL.Get(Convert.ToInt32(dt.Rows[i]["FinishProdutFormulaID"])); objFinishProduct.FinishProductPackingType = objPackingType_DL.Get(Convert.ToInt64(dt.Rows[i]["FinishProdutPackingTypeID"])); objFinishProduct.FinishProductStatus = Convert.ToBoolean(dt.Rows[i]["FinishProductStatus"]); objFinishProduct.FinishProductType = Convert.ToString(dt.Rows[i]["FinishProductType"]); objFinishProduct.PrimaryFinishProductQty = Convert.ToDecimal(dt.Rows[i]["PrimaryFinishProductQty"]); objFinishProduct.SKUID = Convert.ToInt32(dt.Rows[i]["SKUID"]); objCollec.Add(objFinishProduct); } return(objCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public Stock Get(long StockID) { Store_DL objStore_DL = new Store_DL(Connection); Material_DL objMaterial_DL = new Material_DL(Connection); BasicProduct_DL objBasicProduct_DL = new BasicProduct_DL(Connection); FinishProduct_DL objFinishProduct_DL = new FinishProduct_DL(Connection); Stock objStock = new Stock(); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@StockID", StockID) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_StockByID", paramList); objStock.StockBasicProduct = objBasicProduct_DL.Get(Convert.ToString(dt.Rows[0]["StockBasicProduct"])); objStock.StockEconomicalQty = Convert.ToDecimal(dt.Rows[0]["StockEconomicalQty"]); objStock.StockFinishProduct = objFinishProduct_DL.Get(Convert.ToString(dt.Rows[0]["StockFinishProduct"])); objStock.StockID = Convert.ToInt64(dt.Rows[0]["StockID"]); objStock.StockMaterial = objMaterial_DL.Get(Convert.ToString(dt.Rows[0]["StockMaterialID"])); objStock.StockMaximumQty = Convert.ToDecimal(dt.Rows[0]["StockMaximumQty"]); objStock.StockMinimumQty = Convert.ToDecimal(dt.Rows[0]["StockMinimumQty"]); objStock.StockQty = Convert.ToDecimal(dt.Rows[0]["StockQty"]); objStock.StockReorderLevel = Convert.ToDecimal(dt.Rows[0]["StockReorderLevel"]); objStock.StockReservedQty = Convert.ToDecimal(dt.Rows[0]["StockReservedQty"]); objStock.StockStatus = (Stock.Status)(dt.Rows[0]["StockStatus"]); objStock.StockStore = objStore_DL.Get(Convert.ToString(dt.Rows[0]["StoreID"])); objStock.StockType = (Stock.Type)(dt.Rows[0]["StockType"]); return(objStock); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MTNBasicProduct Get(long MTNNO, String BasicProductCode) { BasicProduct_DL objBasicProduct_DL = new BasicProduct_DL(Connection); MTN_DL objMTN_DL = new MTN_DL(Connection); MTNBasicProduct objMTNBasicProduct = new MTNBasicProduct(); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNNO", MTNNO), new SqlParameter("@BasicProductCode", BasicProductCode) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MTNBasicProductByID", paramList); if (dt.Rows.Count > 0) { objMTNBasicProduct.BasicProduct = objBasicProduct_DL.Get(Convert.ToString(dt.Rows[0]["MTNBasicProductID"])); objMTNBasicProduct.Batch = "No"; objMTNBasicProduct.MTN = objMTN_DL.Get(Convert.ToInt64(dt.Rows[0]["MTNNO"])); objMTNBasicProduct.ReceivedQty = Convert.ToDecimal(dt.Rows[0]["MTNRceivedQty"]); if (dt.Rows[0]["MTNUnitRate"] != DBNull.Value) { objMTNBasicProduct.UnitRate = Convert.ToDecimal(dt.Rows[0]["MTNUnitRate"]); } if (dt.Rows[0]["MTNTransferQty"] != DBNull.Value) { objMTNBasicProduct.TransferQty = Convert.ToDecimal(dt.Rows[0]["MTNTransferQty"]); } } return(objMTNBasicProduct); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public STDBatch Get(string STDBatchID) { BasicProduct_DL objBasicProductDL = new BasicProduct_DL(Connection); FinishProduct_DL objFinishProductDL = new FinishProduct_DL(Connection); STDBatch objSTDBatch = new STDBatch(); Employee_DL objEmpDL = new Employee_DL(Connection); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@STDBatchID", STDBatchID) }; STDBatch obj = new STDBatch(); DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_STDBatch_By_ID", paramList); if (dt.Rows.Count > 0) { if (dt.Rows[0]["STDBatchID"] != null) { obj.STDBatchID = Convert.ToString(dt.Rows[0]["STDBatchID"]); } if (dt.Rows[0]["STDBatchDescription"] != null) { obj.STDBatchDescription = Convert.ToString(dt.Rows[0]["STDBatchDescription"]); } if (dt.Rows[0]["STDBasicProductCode"] != null) { obj.STDBatchBasicProduct = objBasicProductDL.Get(Convert.ToString(dt.Rows[0]["STDBasicProductCode"])); } if (dt.Rows[0]["STDFinishProductCode"] != null) { obj.STDBatchFinishProduct = objFinishProductDL.Get(Convert.ToString(dt.Rows[0]["STDFinishProductCode"])); } obj.STDBatchSize = Convert.ToDecimal(dt.Rows[0]["STDBatchSize"]); obj.STDBatchInstructedBy = objEmpDL.Get(Convert.ToString(dt.Rows[0]["STDInstructedBy"])); obj.STDInstructedDate = Convert.ToDateTime(dt.Rows[0]["STDInstructedDate"]); obj.STDBatchType = Convert.ToString(dt.Rows[0]["STDBatchType"]); obj.STDDuration = Convert.ToDecimal(dt.Rows[0]["STDDuration"]); obj.EditableBatch = Convert.ToBoolean(dt.Rows[0]["EditableBatch"]); obj.LabourHours = Convert.ToDecimal(dt.Rows[0]["LabourHours"]); obj.MachineHours = Convert.ToDecimal(dt.Rows[0]["MachineHours"]); obj.InputQty = Convert.ToDecimal(dt.Rows[0]["InputQty"]); obj.OutputQty = Convert.ToDecimal(dt.Rows[0]["OutputQty"]); if (dt.Rows[0]["SpecificGravity"] != DBNull.Value) { obj.SpecificGravity = Convert.ToBoolean(dt.Rows[0]["SpecificGravity"]); } if (dt.Rows[0]["Water"] != DBNull.Value) { obj.Water = Convert.ToDecimal(dt.Rows[0]["Water"]); } } return(obj); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }