Ejemplo n.º 1
0
        public RPDBatchActivityDetails Get(long RPDBatchActivityDetailsID)
        {
            MRPDataSetRPD           dsMRP              = new MRPDataSetRPD();
            RPDBatch_DL             objRPDBatch_DL     = new RPDBatch_DL(Connection);
            Employee_DL             objEmployee_DL     = new Employee_DL(Connection);
            MainActivity_DL         objMainActivity_DL = new MainActivity_DL(Connection);
            Machine_DL              objMachine_DL      = new Machine_DL(Connection);
            Material_DL             objMaterial_DL     = new Material_DL(Connection);
            RPDBatchActivityDetails obj = new RPDBatchActivityDetails();

            try
            {
                da.FillByID(dsMRP.tblRPDBatchActivityDetails, RPDBatchActivityDetailsID);
                if (dsMRP.tblRPDBatchActivityDetails.Rows.Count > 0)
                {
                    foreach (MRPDataSetRPD.tblRPDBatchActivityDetailsRow dr in dsMRP.tblRPDBatchActivityDetails)
                    {
                        obj.BatchActDetailsID = Convert.ToInt64(dr.BatchActDetailsID);
                        obj.Comments          = dr.Comments;
                        obj.FinalQty          = dr.FinalQty;
                        obj.Frequency         = dr.Frequency;
                        obj.InitialVolume     = dr.InitialVolume;
                        obj.LossQty           = dr.LossQty;
                        obj.NoOfTrays         = dr.NoOfTrays;
                        obj.RPDBatchActID     = Convert.ToInt64(dr.RPDBatchActID);
                        obj.SieveSize         = dr.SieveSize;
                        obj.StartQty          = dr.StartQty;
                        obj.StartTime         = dr.StartTime;
                        obj.StopQty           = dr.StopQty;
                        obj.StopTime          = dr.StopTime;
                        obj.SupervisedBy      = dr.SupervisedBy;
                    }
                    return(obj);
                }
                return(null);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }

            finally
            {
                dsMRP.Dispose();

                objRPDBatch_DL     = null;
                objEmployee_DL     = null;
                objMainActivity_DL = null;
                objMachine_DL      = null;
            }
        }