public MTNFinishProduct Get(long MTNNO, String FinishProductCode) { FinishProduct_DL objFinishProduct_DL = new FinishProduct_DL(Connection); MTN_DL objMTN_DL = new MTN_DL(Connection); MTNFinishProduct objMTNFinishProduct = new MTNFinishProduct(); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNNO", MTNNO), new SqlParameter("@FinishProductCode", FinishProductCode) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MTNFinishProductByID", paramList); if (dt.Rows.Count > 0) { objMTNFinishProduct.FinishProduct = objFinishProduct_DL.Get(Convert.ToString(dt.Rows[0]["MTNFinishProductID"])); objMTNFinishProduct.Batch = "No"; objMTNFinishProduct.Description = "No"; objMTNFinishProduct.MTN = objMTN_DL.Get(Convert.ToInt64(dt.Rows[0]["MTNNO"])); objMTNFinishProduct.ReceivedQty = Convert.ToDecimal(dt.Rows[0]["MTNRceivedQty"]); if (dt.Rows[0]["MTNUnitRate"] != DBNull.Value) { objMTNFinishProduct.UnitRate = Convert.ToDecimal(dt.Rows[0]["MTNUnitRate"]); } else { objMTNFinishProduct.UnitRate = 0; } objMTNFinishProduct.TransferQty = Convert.ToDecimal(dt.Rows[0]["MTNTransferQty"]); } return(objMTNFinishProduct); } 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 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); } }