//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 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 MTNTransferList Get(long MTNNO, long StcokID, long GRNNO) { MTN_DL objMTN_DL = new MTN_DL(Connection); Stock_DL objStock_DL = new Stock_DL(Connection); GRN_DL objGRN_DL = new GRN_DL(Connection); MTNTransferList objMTNTransferList = new MTNTransferList(); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@Original_MTNNO", MTNNO), new SqlParameter("@Original_StockID", StcokID), new SqlParameter("@Original_GRNNO", GRNNO) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MTNTransferListByID", paramList); objMTNTransferList.GRN = objGRN_DL.Get(Convert.ToInt64(dt.Rows[0]["GRNNO"])); objMTNTransferList.MTN = objMTN_DL.Get(Convert.ToInt64(dt.Rows[0]["MTNNO"])); objMTNTransferList.Stock = objStock_DL.Get(Convert.ToInt64(dt.Rows[0]["StockID"])); objMTNTransferList.Qty = Convert.ToDecimal(dt.Rows[0]["StockID"]); return(objMTNTransferList); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
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); } }