Example #1
0
        public PRPDBatchActivityInstructions.PRPDBatchActivityInstructionsCollec Get()
        {
            try
            {
                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_PRPDBatchActivityInstructions");

                PRPDBatchActivityInstructions.PRPDBatchActivityInstructionsCollec objCollec = new PRPDBatchActivityInstructions.PRPDBatchActivityInstructionsCollec();
                PRPDBatchActivityInstructions obj = new PRPDBatchActivityInstructions();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        obj.PRPDBatchActivityInstructionsID = Convert.ToInt64(dt.Rows[i]["PRPDBatchActivityInstructionsID"]);
                        obj.PRPDBatch       = objPRPDBatch_DL.Get(Convert.ToString(dt.Rows[i]["PRPDBatchID"]));
                        obj.Machine         = objMachine_DL.Get(Convert.ToString(dt.Rows[i]["MachineID"]));
                        obj.Activity        = objMainActivity_DL.Get(Convert.ToInt64(dt.Rows[i]["ActivityID"]));
                        obj.ActivityID      = Convert.ToInt64(dt.Rows[i]["ActivityID"]);
                        obj.MachineCode     = Convert.ToString(dt.Rows[i]["MachineID"]);
                        obj.ParticleSize    = Convert.ToString(dt.Rows[i]["ParticleSize"]);
                        obj.InstructionDesc = Convert.ToString(dt.Rows[i]["InstructionDesc"]);

                        objCollec.Add(obj);
                    }
                }

                return(objCollec);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Example #2
0
        public RPDBatchActivityInstructions Get(long ID)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchActivityInstructionsID", ID)
                };


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

                RPDBatchActivityInstructions obj = new RPDBatchActivityInstructions();

                if (dt.Rows.Count > 0)
                {
                    obj.ID           = Convert.ToInt64(dt.Rows[0]["RPDBatchActivityInstructionsID"]);
                    obj.RPDBatch     = objRPDBatch_DL.Get(Convert.ToString(dt.Rows[0]["BatchNo"]));
                    obj.Activity     = objMainActivity_DL.Get(Convert.ToInt64(dt.Rows[0]["ActivityID"]));
                    obj.Machine      = objMachine_DL.Get(Convert.ToString(dt.Rows[0]["MachineID"]));
                    obj.ParticleSize = Convert.ToString(dt.Rows[0]["ParticleSize"]);
                    obj.Description  = Convert.ToString(dt.Rows[0]["InstructionDesc"]);
                }

                return(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Example #3
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);
            }
        }
Example #4
0
        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);
            }
        }