Beispiel #1
0
 public DataLayer.PP_RoutFacilityInfo ConvertToTable(RoutFacilityInfoModel model)
 {
     DataLayer.PP_RoutFacilityInfo tbl = new DataLayer.PP_RoutFacilityInfo();
     //  tbl.RoutFacilityID = model.RoutFacilityID;
     tbl.RoutID     = model.RoutID;
     tbl.FaciltiyID = model.FaciltiyID;
     // part id saved in Master
     tbl.PartID          = _model.PartID;
     tbl.TimeDurationMin = model.TimeDurationMin;
     tbl.YearID          = model.YearID;
     tbl.BranchID        = model.BranchID;
     tbl.UserID          = model.UserID;
     tbl.RegisteredDate  = model.RegisteredDate;
     tbl.PartID          = model.PartID;
     return(tbl);
 }
Beispiel #2
0
        public RoutFacilityInfoModel ConvertToModel(DataLayer.PP_RoutFacilityInfo tbl)
        {
            RoutFacilityInfoModel model = new RoutFacilityInfoModel();

            model.RoutFacilityID  = tbl.RoutFacilityID;
            model.RoutID          = tbl.RoutID;
            model.FaciltiyID      = tbl.FaciltiyID;
            model.PartID          = tbl.PartID;
            model.TimeDurationMin = tbl.TimeDurationMin;
            model.YearID          = tbl.YearID;
            model.BranchID        = tbl.BranchID;
            model.UserID          = tbl.UserID;
            model.RegisteredDate  = tbl.RegisteredDate;
            model.FaciltiyName    = context.PP_FacilityInfos.Where(q => q.FacilityID == tbl.FaciltiyID).FirstOrDefault().FacilityName;
            model.PartName        = context.MRP_PartInfos.Where(q => q.PartID == tbl.PartID).FirstOrDefault().PartName;
            return(model);
        }