public GRNMaterialsCollec Get() { try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_GRNMaterials"); GRNMaterialsCollec objGRNMatCollec = new GRNMaterialsCollec(); for (int i = 0; i < dt.Rows.Count; i++) { GRNMaterials objGRNMaterial = new GRNMaterials(); objGRNMaterial.GRN = objGRN_DL.Get(Convert.ToInt64(dt.Rows[i]["GRNNO"])); objGRNMaterial.GrossQty = Convert.ToDecimal(dt.Rows[i]["GrossQty"]); objGRNMaterial.Material = objMaterial_DL.Get(Convert.ToString(dt.Rows[i]["MaterialCode"])); objGRNMaterial.NetQty = Convert.ToDecimal(dt.Rows[i]["NetQty"]); objGRNMaterial.Remarks = Convert.ToString(dt.Rows[i]["Remarks"]); objGRNMaterial.UnitPrice = Convert.ToDecimal(dt.Rows[i]["UnitPrice"]); objGRNMatCollec.Add(objGRNMaterial); } return(objGRNMatCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
//public Decimal BatchCost(String PRPDBatchID) //{ // try // { // daPRPDBatchTable.Connection = Connection; // return Convert.ToDecimal(daPRPDBatchTable.SPGET_PRPDBatchCost(PRPDBatchID)); // } // catch (Exception ex) // { // throw new Exception(ex.Message, ex); // } // finally // { // daPRPDBatchTable.Dispose(); // } //} public PRPDBatchCollec Get() { try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_PRPDBatch"); PRPDBatchCollec objCollec = new PRPDBatchCollec(); PRPDBatch obj = new PRPDBatch(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { obj.PRPDBatchID = Convert.ToString(dt.Rows[i]["PRPDBatchID"]); obj.PRPDBatchSuperviser = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchSuperviserID"])); obj.PRPDBatchMaterial = objMaterial_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchMaterialCode"])); obj.PRPDBatchQty = Convert.ToDecimal(dt.Rows[i]["PRPDBatchQty"]); obj.PRPDBatchInstructedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchInstructedBy"])); obj.PRPDBatchInstructedDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchInstructedDate"]); obj.PRPDBatchStartedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchStartedBy"])); obj.PRPDBatchStartDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchStartDate"]); obj.PRPDBatchApprovedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchApprovedBy"])); obj.PRPDBatchApprovedDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchApprovedDate"]); obj.PRPDBatchEndBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchEndBy"])); obj.PRPDBatchEndDate = Convert.ToDateTime(dt.Rows[i]["PRPDBatchEndDate"]); obj.Status = (PRPDBatch.PRPDBatchStatus)Enum.Parse(typeof(PRPDBatch.PRPDBatchStatus), Convert.ToString(dt.Rows[i]["PRPDBatchStatus"])); obj.PRPDBatchMTNIN = Convert.ToInt64(dt.Rows[i]["MTNIN"]); obj.PRPDBatchMTNOUT = objMTN_DL.Get(Convert.ToInt32(dt.Rows[i]["MTNOUT"])); obj.UnitCost = Convert.ToDecimal(dt.Rows[i]["UnitCost"]); obj.PRPDBatchInspectedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["InspectedBy"])); obj.PRPDBatchInspectedDate = Convert.ToDateTime(dt.Rows[i]["InspectedDate"]); obj.PRPDBatchHandOverBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["HandOverBy"])); obj.PRPDBatchHandOverDate = Convert.ToDateTime(dt.Rows[i]["HandOverDate"]); obj.PRPDBatchFinalQty = Convert.ToDecimal(dt.Rows[i]["FinalQty"]); obj.PRPDSampleSize = Convert.ToString(dt.Rows[i]["SampleSize"]); obj.PRPDBatchComments = Convert.ToString(dt.Rows[i]["Comments"]); obj.Type = (PRPDBatch.PRPDType)Convert.ToInt64(dt.Rows[i]["BatchType"]); obj.PRPDBatchTotalImpurities = Convert.ToDecimal(dt.Rows[i]["TotalImpurities"]); obj.PRPDCAPID = Convert.ToDecimal(dt.Rows[i]["PRPDCAPID"]); obj.MRIN = Convert.ToInt64(dt.Rows[i]["MRIN"]); if (dt.Rows[i]["OutSourceQty"] != DBNull.Value) { obj.OutSourceQty = Convert.ToDecimal(dt.Rows[i]["OutSourceQty"]); } objCollec.Add(obj); } } return(objCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public RPDBatchProduction Get(String RPDBatchID, String MaterialCode) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@RPDBatchID", RPDBatchID), new SqlParameter("@MaterialCode", MaterialCode) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_RPDBatchProduction_By_ID", paramList); RPDBatchProduction obj = new RPDBatchProduction(); if (dt.Rows.Count > 0) { obj.RPDBatch = objRPDBatch_DL.Get(Convert.ToString(dt.Rows[0]["RPDBatchID"])); obj.MaterialQuantity = Convert.ToDecimal(dt.Rows[0]["Qty"]); obj.Material = objMaterial_DL.Get(Convert.ToString(dt.Rows[0]["MaterialCode"])); } return(obj); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MTNMaterial Get(long MTNNO, String MaterialCode) { Material_DL objMaterial_DL = new Material_DL(Connection); MTN_DL objMTN_DL = new MTN_DL(Connection); MTNMaterial objMTNMaterial = new MTNMaterial(); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@Original_MTNNO", MTNNO), new SqlParameter("@Original_MTNMaterialCode", MaterialCode) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPDELETE_MTNMaterial", paramList); objMTNMaterial.Material = objMaterial_DL.Get(Convert.ToString(dt.Rows[0]["MTNMaterialCode"])); objMTNMaterial.Batch = "No"; objMTNMaterial.Description = Convert.ToString(dt.Rows[0]["MTNDescription"]); objMTNMaterial.MTN = objMTN_DL.Get(Convert.ToInt64(dt.Rows[0]["MTNNO"])); objMTNMaterial.TransferQty = Convert.ToDecimal(dt.Rows[0]["MTNTransferQty"]); objMTNMaterial.UnitRate = Convert.ToDecimal(dt.Rows[0]["MTNUnitRate"]); objMTNMaterial.ReceivedQty = Convert.ToDecimal(dt.Rows[0]["ReceivedQty"]); return(objMTNMaterial); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public FormulaMaterial Get(long FormulaID, String MaterialCode, String FormulaPart) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@FormulaID", FormulaID), new SqlParameter("@FormulaMaterialCode", MaterialCode), new SqlParameter("@FormulaPart", FormulaPart) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_FormulaMaterial_ByID", paramList); FormulaMaterial obj = new FormulaMaterial(); if (dt.Rows.Count > 0) { obj.Material = objMaterial_DL.Get(Convert.ToString(dt.Rows[0]["FormulaMaterialCode"])); obj.Formula = objFormula_DL.Get(Convert.ToInt32(dt.Rows[0]["FormulaID"])); obj.FormulaPart = Convert.ToString(dt.Rows[0]["FormulaPart"]); obj.FormulaProductQty = Convert.ToDecimal(dt.Rows[0]["FormulaQty"]); } return(obj); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public RPDBatchCollec Get() { try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_RPDBatch"); RPDBatchCollec objCollec = new RPDBatchCollec(); RPDBatch obj = new RPDBatch(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { obj.RPDBatchID = Convert.ToString(dt.Rows[i]["RPDBatchID"]); obj.RPDBatchSupervisedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchSuperviserID"])); obj.RPDBatchMaterial = objMaterial_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchMaterialCode"])); obj.RPDBatchQty = Convert.ToDecimal(dt.Rows[i]["RPDBatchQty"]); obj.RPDBatchInstructedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchInstructedBy"])); obj.RPDBatchInstructedDate = Convert.ToDateTime(dt.Rows[i]["RPDBatchInstructedDate"]); obj.RPDBatchStartDate = Convert.ToDateTime(dt.Rows[i]["RPDBatchStartDate"]); obj.RPDBatchEndDate = Convert.ToDateTime(dt.Rows[i]["RPDBatchEndDate"]); obj.RPDBatchFinalQty = Convert.ToDecimal(dt.Rows[i]["RPDBatchFinalQty"]); obj.Status = (RPDBatch.RPDBatchStatus)Enum.Parse(typeof(RPDBatch.RPDBatchStatus), Convert.ToString(dt.Rows[i]["RPDBatchStatus"])); obj.RPDBatchMR = objMR_DL.Get(Convert.ToInt64(dt.Rows[i]["RPDBatchMRNO"])); obj.Type = Convert.ToString(dt.Rows[i]["RPDBatchType"]); obj.ApprovedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchApprovedBy"])); obj.ApprovedDate = Convert.ToDateTime(dt.Rows[i]["RPDBatchApprovedDate"]); obj.EndBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchEndBy"])); objCollec.Add(obj); } } return(objCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MRMaterialCollec Get() { try { DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MRMaterial"); MRMaterialCollec objMRMaterialCollec = new MRMaterialCollec(); for (int i = 0; i < dt.Rows.Count; i++) { MRMaterial objMRMaterial = new MRMaterial(); objMRMaterial.Description = Convert.ToString(dt.Rows[i]["MRDescription"]); objMRMaterial.Material = objMaterial_DL.Get(Convert.ToString(dt.Rows[i]["MRMaterialCode"])); objMRMaterial.MR = objMR_DL.Get(Convert.ToInt64(dt.Rows[i]["MRNO"])); objMRMaterial.MRBINNo = Convert.ToString(dt.Rows[i]["MRBINNo"]); objMRMaterial.ReqdQty = Convert.ToDecimal(dt.Rows[i]["MRReqdQty"]); objMRMaterial.IssuedQty = Convert.ToDecimal(dt.Rows[i]["MRIssuedQty"]); if (dt.Rows[i]["MRUnitRate"] != null) { objMRMaterial.UniRate = Convert.ToDecimal(dt.Rows[i]["MRUnitRate"]); } else { objMRMaterial.UniRate = 0; } objMRMaterial.UnitCode = objMaterial_DL.Get(Convert.ToString(dt.Rows[i]["MRMaterialCode"])).MatUnit.UnitCode; objMRMaterialCollec.Add(objMRMaterial); } return(objMRMaterialCollec); } 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); } }