public virtual bool Edit(YZJ_StatusModel model) { try { YZJ_Status entity = m_Rep.GetById(model.id); if (entity == null) { return(false); } entity.id = model.id; entity.available = model.available; entity.StdRollId = model.StdRollId; entity.StdName = model.StdName; entity.StdSex = model.StdSex; entity.native = model.native; entity.nation = model.nation; entity.Entrance_Year = model.Entrance_Year; entity.Household_Registration_Category = model.Household_Registration_Category; entity.HouseholdAddress = model.HouseholdAddress; entity.CurrentAddress = model.CurrentAddress; entity.Photo = model.Photo; entity.PhoneNumber = model.PhoneNumber; entity.UrgentPhoneNumber = model.UrgentPhoneNumber; entity.PaperType = model.PaperType; entity.PaperNumber = model.PaperNumber; entity.UsedName = model.UsedName; entity.email = model.email; entity.PostCode = model.PostCode; entity.IsLeagueeMember = model.IsLeagueeMember; entity.IsYoungPineer = model.IsYoungPineer; entity.GuardianNo1 = model.GuardianNo1; entity.G1PhoneNumber = model.G1PhoneNumber; entity.G1Relationship = model.G1Relationship; entity.GuardianNo2 = model.GuardianNo2; entity.G2PhoneNumber = model.G2PhoneNumber; entity.G2Relationship = model.G2Relationship; entity.AlmaMater = model.AlmaMater; entity.StdCategory = model.StdCategory; entity.StatusState = model.StatusState; if (m_Rep.Edit(entity)) { return(true); } else { return(false); } } catch (Exception ex) { return(false); } }
public virtual YZJ_StatusModel GetById(string id) { if (IsExists(id)) { YZJ_Status entity = m_Rep.GetById(id); YZJ_StatusModel model = new YZJ_StatusModel(); model.id = entity.id; model.available = entity.available; model.StdRollId = entity.StdRollId; model.StdName = entity.StdName; model.StdSex = entity.StdSex; model.native = entity.native; model.nation = entity.nation; model.Entrance_Year = entity.Entrance_Year; model.Household_Registration_Category = entity.Household_Registration_Category; model.HouseholdAddress = entity.HouseholdAddress; model.CurrentAddress = entity.CurrentAddress; model.Photo = entity.Photo; model.PhoneNumber = entity.PhoneNumber; model.UrgentPhoneNumber = entity.UrgentPhoneNumber; model.PaperType = entity.PaperType; model.PaperNumber = entity.PaperNumber; model.UsedName = entity.UsedName; model.email = entity.email; model.PostCode = entity.PostCode; model.IsLeagueeMember = entity.IsLeagueeMember; model.IsYoungPineer = entity.IsYoungPineer; model.GuardianNo1 = entity.GuardianNo1; model.G1PhoneNumber = entity.G1PhoneNumber; model.G1Relationship = entity.G1Relationship; model.GuardianNo2 = entity.GuardianNo2; model.G2PhoneNumber = entity.G2PhoneNumber; model.G2Relationship = entity.G2Relationship; model.AlmaMater = entity.AlmaMater; model.StdCategory = entity.StdCategory; model.StatusState = entity.StatusState; return(model); } else { return(null); } }