Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        public Batch Get(String BatchID)
        {
            Batch       objBatch      = new Batch();
            Employee_DL objEmplyeeDL  = new Employee_DL(Connection);
            Batch_DL    objBatchDL    = new Batch_DL(Connection);
            STDBatch_DL objSTDBatchDL = new STDBatch_DL(Connection);


            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@BatchID", BatchID)
                };

                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_Batch_By_ID", paramList);


                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["BatchApprovedBy"].ToString() != "N/A")
                    {
                        objBatch.BatchApprovedBy = objEmplyeeDL.Get(Convert.ToString(dt.Rows[0]["BatchApprovedBy"]));
                    }
                    if (dt.Rows[0]["BatchApprovedDate"] != null)
                    {
                        objBatch.BatchApprovedDate = Convert.ToDateTime(dt.Rows[0]["BatchApprovedDate"]);
                    }

                    objBatch.BatchDivideCount = Convert.ToInt32(dt.Rows[0]["BatchDivideCount"]);

                    if (dt.Rows[0]["BatchEndDate"] != null)
                    {
                        objBatch.BatchEndDate = Convert.ToDateTime(dt.Rows[0]["BatchEndDate"]);
                    }

                    if (dt.Rows[0]["BatchGeneratedBy"].ToString() != "N/A")
                    {
                        objBatch.BatchGenerateBy = objEmplyeeDL.Get(Convert.ToString(dt.Rows[0]["BatchGeneratedBy"]));
                    }

                    objBatch.BatchGenerateDate = Convert.ToDateTime(dt.Rows[0]["BatchGeneratedDate"]);
                    objBatch.BatchID           = Convert.ToString(dt.Rows[0]["BatchID"]);

                    if (dt.Rows[0]["BatchStartDate"] != null)
                    {
                        objBatch.BatchStartDate = Convert.ToDateTime(dt.Rows[0]["BatchStartDate"]);
                    }

                    objBatch.BatchStatus = (Batch.Status)dt.Rows[0]["BatchStatus"];

                    if (dt.Rows[0]["BatchSuperviser"].ToString() != "N/A")
                    {
                        objBatch.BatchSuperviser = objEmplyeeDL.Get(Convert.ToString(dt.Rows[0]["BatchSuperviser"]));
                    }

                    objBatch.BatchType = Convert.ToString(dt.Rows[0]["BatchType"]);

                    if (dt.Rows[0]["BatchFinalQty"] != DBNull.Value)
                    {
                        objBatch.BatchFinalQty = Convert.ToDecimal(dt.Rows[0]["BatchFinalQty"]);
                    }

                    objBatch.BatchSize = Convert.ToDecimal(dt.Rows[0]["BatchSize"]);

                    if (dt.Rows[0]["FinalizedBy"].ToString() != "")
                    {
                        objBatch.FinalizedBy = objEmplyeeDL.Get(Convert.ToString(dt.Rows[0]["FinalizedBy"]));
                    }

                    if (dt.Rows[0]["FinalizedDate"] != DBNull.Value)
                    {
                        objBatch.FinalizedDate = Convert.ToDateTime(dt.Rows[0]["FinalizedDate"]);
                    }

                    objBatch.StandardBatch = objSTDBatchDL.Get(Convert.ToString(dt.Rows[0]["BatchSTDBatchID"]));
                }

                return(objBatch);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }