Ejemplo n.º 1
0
        public List<MachinePrepareItem_mpit_Info> GetPrepareProjectsByProjectID(string ProjectID)
        {
            List<MachinePrepareItem_mpit_Info> returnList = null;

            try
            {
                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        IEnumerable<MachinePrepareItem_mpit> searchDatas = from t in db.MachinePrepareItem_mpit
                                                                           where t.mpit_lIsDeleted == false
                                                                           //orderby t.mpit_PIPFID
                                                                           select t;

                        searchDatas = searchDatas.Where(w => w.mpit_PIPFID.ToString().ToUpper().Trim().Equals(ProjectID.Trim().ToUpper()));

                        Master.MachineMasterDA machineDA = new DAL.SqlDAL.HBPMS.Master.MachineMasterDA();
                        PrepareProjectMasterDA PPDA = new PrepareProjectMasterDA();

                        if (searchDatas != null && searchDatas.Count() > 0)
                        {
                            returnList = new List<MachinePrepareItem_mpit_Info>();

                            foreach (MachinePrepareItem_mpit item in searchDatas)
                            {
                                MachinePrepareItem_mpit_Info info = Common.General.CopyObjectValue<MachinePrepareItem_mpit, MachinePrepareItem_mpit_Info>(item);

                                info.MachineItem = machineDA.GetMachineItem(info.mpit_cDCMPID.Trim());
                                info.PrepareProjectItem = PPDA.GetPPItems(info.mpit_PIPFID);
                                info.ppmSeq = info.PrepareProjectItem.ppm_iSeq;

                                returnList.Add(info);
                            }
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return returnList;
        }
Ejemplo n.º 2
0
        public List<MachinePrepareItem_mpit_Info> SearchRecords(Model.IModel.IModelObject searchCondition)
        {
            List<MachinePrepareItem_mpit_Info> returnList = null;

            if (searchCondition != null)
            {
                MachinePrepareItem_mpit_Info query = searchCondition as MachinePrepareItem_mpit_Info;

                try
                {
                    try
                    {
                        using (MainDBDataContext db = new MainDBDataContext())
                        {
                            IEnumerable<MachinePrepareItem_mpit > searchDatas = from t in db.MachinePrepareItem_mpit
                                                                         where t.mpit_lIsDeleted==false
                                                                         orderby t.mpit_PIPFID
                                                                         select t;

                            Master.MachineMasterDA machineDA = new DAL.SqlDAL.HBPMS.Master.MachineMasterDA();
                            PrepareProjectMasterDA PPDA = new PrepareProjectMasterDA();

                            if (searchDatas != null && searchDatas.Count() > 0)
                            {
                                returnList = new List<MachinePrepareItem_mpit_Info>();

                                foreach (MachinePrepareItem_mpit item in searchDatas)
                                {
                                    MachinePrepareItem_mpit_Info info = Common.General.CopyObjectValue<MachinePrepareItem_mpit , MachinePrepareItem_mpit_Info>(item);

                                    info.MachineItem = machineDA.GetMachineItem(info.mpit_cDCMPID.Trim());
                                    info.PrepareProjectItem = PPDA.GetPPItems(info.mpit_PIPFID);
                                    info.ppmSeq = info.PrepareProjectItem.ppm_iSeq;

                                    returnList.Add(info);
                                }
                            }
                        }
                    }
                    catch (Exception Ex)
                    {

                        throw Ex;
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return returnList;
        }
Ejemplo n.º 3
0
        public List<MachineStopReasonProfile_msrp_Info> GetStopReasonByReasonID(int ReasonID)
        {
            List<MachineStopReasonProfile_msrp_Info> returnList = null;

            try
            {
                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        IEnumerable<MachineStopReasonProfile_msrp> searchDatas = from t in db.MachineStopReasonProfile_msrp
                                                                           where t.msrp_lIsDeleted  == false
                                                                           //orderby t.mpit_PIPFID
                                                                           select t;

                        searchDatas = searchDatas.Where(w => w.msrp_iSRPFID ==ReasonID );

                        Master.MachineMasterDA machineDA = new DAL.SqlDAL.HBPMS.Master.MachineMasterDA();
                        StopReasonDA stopReadDA = new StopReasonDA();

                        if (searchDatas != null && searchDatas.Count() > 0)
                        {
                            returnList = new List<MachineStopReasonProfile_msrp_Info>();

                            foreach (MachineStopReasonProfile_msrp item in searchDatas)
                            {
                                MachineStopReasonProfile_msrp_Info info = Common.General.CopyObjectValue<MachineStopReasonProfile_msrp, MachineStopReasonProfile_msrp_Info>(item);

                                info.MachineItem = machineDA.GetMachineItem(info.msrp_cMachineID .Trim());
                                info.StopReasonItem = stopReadDA.DisplayRecord(ReasonID);
                                info.mtrSeq = info.StopReasonItem.srm_iSeq;

                                returnList.Add(info);
                            }
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return returnList;
        }