public ActivityCollec Get_STDBatch(string STDBatchID) { ActivityCollec objActivityCollec = new ActivityCollec(); STDBatch_DL objBatchDL = new STDBatch_DL(Connection); MainActivity_DL objMainActDL = new MainActivity_DL(Connection); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@ActSTDBatchID", STDBatchID) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_Activity_By_STDBatchID", paramList); for (int i = 0; i < dt.Rows.Count; i++) { Activity obj = new Activity(); if (dt.Rows[i]["ActID"] != null) { obj.ActivityID = Convert.ToInt64(dt.Rows[i]["ActID"]); } if (dt.Rows[i]["ActMainActID"] != null) { obj.ActMainActivity = objMainActDL.Get(Convert.ToInt64(dt.Rows[i]["ActMainActID"])); } if (dt.Rows[i]["ActSTDBatchID"] != null) { obj.ActSTDBatch = objBatchDL.Get((Convert.ToString(dt.Rows[i]["ActSTDBatchID"]))); } obj.ActDuration = Convert.ToDecimal(dt.Rows[i]["ActDuration"]); obj.ActManHours = Convert.ToDecimal(dt.Rows[i]["ActManHours"]); obj.ActCost = Convert.ToDecimal(dt.Rows[i]["ActCost"]); obj.SequenceNo = Convert.ToInt32(dt.Rows[i]["SequenceNo"]); obj.Part = Convert.ToString(dt.Rows[i]["Part"]); obj.InstructedBy = Convert.ToString(dt.Rows[i]["InstructedBy"]); obj.LastEdited = Convert.ToDateTime(dt.Rows[i]["LastEdited"]); obj.BlockNextActivity = Convert.ToBoolean(dt.Rows[i]["BlockNextActivity"]); objActivityCollec.Add(obj); } return(objActivityCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public BatchActivity Get(string BatchID, long ActID) { BatchActivity objBatchActivity = new BatchActivity(); Batch_DL objBatch_DL = new Batch_DL(Connection); Employee_DL objEmployee_DL = new Employee_DL(Connection); MainActivity_DL objMainActivity_DL = new MainActivity_DL(Connection); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@ActID", ActID), new SqlParameter("@BatchID", BatchID) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_BatchActivity_By_Batch_Act", paramList); if (dt.Rows.Count != 0) { objBatchActivity.MainActivity = objMainActivity_DL.Get(Convert.ToInt64(dt.Rows[0]["ActID"])); objBatchActivity.BatchActID = Convert.ToInt64(dt.Rows[0]["BatchActID"]); objBatchActivity.Batch = objBatch_DL.Get(dt.Rows[0]["BatchID"].ToString()); objBatchActivity.BatchActStatus = (BatchActivity.Status)dt.Rows[0]["BatchActStatus"]; if (dt.Rows[0]["SequenceNo"] != DBNull.Value) { objBatchActivity.SequenceNo = Convert.ToInt32(dt.Rows[0]["SequenceNo"]); } objBatchActivity.Part = dt.Rows[0]["Part"].ToString(); objBatchActivity.LastEdited = Convert.ToDateTime(dt.Rows[0]["LastEdited"]); objBatchActivity.BlockNextActivity = Convert.ToBoolean(dt.Rows[0]["BlockNextActivity"]); objBatchActivity.ActMethod = Convert.ToString(dt.Rows[0]["ActMethod"]); if (dt.Rows[0]["StartQty"] != DBNull.Value) { objBatchActivity.StartQty = Convert.ToDecimal(dt.Rows[0]["StartQty"]); } if (dt.Rows[0]["StopQty"] != DBNull.Value) { objBatchActivity.StopQty = Convert.ToDecimal(dt.Rows[0]["StopQty"]); } if (dt.Rows[0]["SupervisedBy"] != DBNull.Value) { objBatchActivity.SupervisedBy = objEmployee_DL.Get(dt.Rows[0]["SupervisedBy"].ToString()); } } return(objBatchActivity); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public DataTable Get_DataView(string STDBatchID) { ActivityCollec objActivityCollec = new ActivityCollec(); STDBatch_DL objBatchDL = new STDBatch_DL(Connection); MainActivity_DL objMainActDL = new MainActivity_DL(Connection); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@ActSTDBatchID", STDBatchID) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_Activity_By_STDBatchID", paramList); return(dt); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }