// GET: THUs/Create public ActionResult Create() { THU obj = new THU(); obj.THU_MA = CreateID.CreateID_ByteText(); return(View(obj)); }
public ActionResult DeleteConfirmed(string id) { THU tHU = db.THUs.Find(id); db.THUs.Remove(tHU); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "THU_MA,THU_TEN")] THU tHU) { if (ModelState.IsValid) { db.Entry(tHU).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tHU)); }
public ActionResult Create([Bind(Include = "THU_MA,THU_TEN")] THU tHU) { if (ModelState.IsValid) { db.THUs.Add(tHU); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tHU)); }
public ActionResult LogOn(THU.LabSystem.Models.LogOnModel model) { ViewBag.ErrorMsg = string.Empty; if (ModelState.IsValid) { try { NHExt.Runtime.Proxy.AgentInvoker invoker = new NHExt.Runtime.Proxy.AgentInvoker(); invoker.AssemblyName = "THU.LabSystemBP.Agent.ValidateUserBPProxy"; invoker.DllName = "THU.LabSystemBP.Agent.dll"; invoker.AppendField(new NHExt.Runtime.Proxy.PropertyField() { FieldName = "Code", FieldValue = model.Code }); invoker.AppendField(new NHExt.Runtime.Proxy.PropertyField() { FieldName = "Password", FieldValue = NHExt.Runtime.Util.EncryptHelper.Encrypt(model.Password) }); // invoker.AppendField(new NHExt.Runtime.Proxy.PropertyField() { FieldName = "Org", FieldValue = model.Org }); invoker.SourcePage = "IWEHAVE.Login"; THU.LabSystemBE.Deploy.UserDTO usrDTO = invoker.Do<THU.LabSystemBE.Deploy.UserDTO>(); if (usrDTO == null) { ViewBag.ErrorMsg = "用户名或密码错误"; } else { NHExt.Runtime.Auth.AuthContext.SetContext(usrDTO.ID, usrDTO.Code, usrDTO.Name, usrDTO.Password, string.Empty); THU.LabSystem.AuthExt.AuthExtCookie.SetRole(usrDTO.Type); if (usrDTO.Type == THU.LabSystemBE.Deploy.UserTypeEnumDTO.Admin.EnumValue) { return RedirectToAction("Main", "Admin/AdminConsole"); } else if (usrDTO.Type == THU.LabSystemBE.Deploy.UserTypeEnumDTO.User.EnumValue) { return RedirectToAction("Main", "User/UserConsole"); } else { AuthExt.AuthExtCookie.Clear(); } } } catch (Exception ex) { ViewBag.ErrorMsg = "用户登录失败,错误原因:" + ex.Message; } } else { ViewBag.ErrorMsg = "登录数据录入错误"; } return LogOn(); }
// GET: THUs/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } THU tHU = db.THUs.Find(id); if (tHU == null) { return(HttpNotFound()); } return(View(tHU)); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.ForbidUserDTO dto , THU.LabSystemBE.ForbidUser entity) { base.FromDTO(dto,entity); if(dto.User <=0){ entity.UserKey = null; } else { entity.UserKey = new EntityKey<THU.LabSystemBE.User>(dto.User); } entity.StartTime = dto.StartTime; entity.EndTime = dto.EndTime; this.FromDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.DeviceDTO dto , THU.LabSystemBE.Device entity) { base.FromDTO(dto,entity); entity.Name = dto.Name; if(dto.Type > 0) { entity.Type=(THU.LabSystemBE.DeviceTypeEnum)dto.Type; } entity.Expression = dto.Expression; entity.Tag = dto.Tag; entity.Price = dto.Price; entity.IsDelete = dto.IsDelete; this.FromDTOImpl(dto); }
private THU.LabSystemBE.Deploy.DeviceUseExDTO TypeConvert(THU.LabSystemBE.Deploy.DeviceUseExDTO obj) { return obj; }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.UserDTO dto) { base.ToDTO(dto); dto.SN = this.SN; dto.Name = this.Name; dto.Tel = this.Tel; dto.Password = this.Password; if (this.DegreeKey != null) { dto.Degree = this.DegreeKey.ID; } if (this.StatusKey != null) { dto.Status = this.StatusKey.ID; } if (this.Type != null) { dto.Type = this.Type.EnumValue; } dto.Email = this.Email; dto.Code = this.Code; dto.IsDelete = this.IsDelete; dto.BeginTime = this.BeginTime; dto.EndTime = this.EndTime; if (this.TeacherKey != null) { dto.Teacher = this.TeacherKey.ID; } this.ToDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.DeviceLogDTO dto) { base.ToDTO(dto); if (this.DeviceKey != null) { dto.Device = this.DeviceKey.ID; } if (this.OperatorKey != null) { dto.Operator = this.OperatorKey.ID; } if (this.Status != null) { dto.Status = this.Status.EnumValue; } dto.BizDate = this.BizDate; this.ToDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.DeviceUseRecordDTO dto) { base.ToDTO(dto); if (this.DeviceKey != null) { dto.Device = this.DeviceKey.ID; } dto.BeginTime = this.BeginTime; dto.EndTime = this.EndTime; dto.Fee = this.Fee; if (this.UserKey != null) { dto.User = this.UserKey.ID; } dto.IsAppoint = this.IsAppoint; if (this.TeacherKey != null) { dto.Teacher = this.TeacherKey.ID; } dto.IsCompleted = this.IsCompleted; if (this.HouseKey != null) { dto.House = this.HouseKey.ID; } dto.IsUsing = this.IsUsing; dto.Price = this.Price; dto.TotalTime = this.TotalTime; this.ToDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.DeviceRepairRecordDTO dto) { base.ToDTO(dto); if (this.DeviceKey != null) { dto.Device = this.DeviceKey.ID; } if (this.UserKey != null) { dto.User = this.UserKey.ID; } if (this.TeacherKey != null) { dto.Teacher = this.TeacherKey.ID; } dto.ReportDate = this.ReportDate; dto.IsCompleted = this.IsCompleted; dto.CompleteDate = this.CompleteDate; if (this.CompleteUserKey != null) { dto.CompleteUser = this.CompleteUserKey.ID; } dto.Fee = this.Fee; dto.ReportMemo = this.ReportMemo; dto.RepairDate = this.RepairDate; dto.AlarmUser = this.AlarmUser; if (this.HouseKey != null) { dto.House = this.HouseKey.ID; } dto.RepairMemo = this.RepairMemo; this.ToDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.OrgDTO dto) { base.ToDTO(dto); dto.Code = this.Code; dto.Name = this.Name; this.ToDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.OrgDTO dto , THU.LabSystemBE.Org entity) { base.FromDTO(dto,entity); entity.Code = dto.Code; entity.Name = dto.Name; this.FromDTOImpl(dto); }
private THU.LabSystemBE.Deploy.DeviceRepairReportExDTO TypeConvert(THU.LabSystemBE.Deploy.DeviceRepairReportExDTO obj) { return obj; }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.CommonEnumDTO dto) { base.ToDTO(dto); dto.Name = this.Name; if (this.Type != null) { dto.Type = this.Type.EnumValue; } dto.Code = this.Code; dto.IsDelete = this.IsDelete; this.ToDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.CommonEnumDTO dto , THU.LabSystemBE.CommonEnum entity) { base.FromDTO(dto,entity); entity.Name = dto.Name; if(dto.Type > 0) { entity.Type=(THU.LabSystemBE.TypeEnum)dto.Type; } entity.Code = dto.Code; entity.IsDelete = dto.IsDelete; this.FromDTOImpl(dto); }
public virtual void FromDTO(THU.LabSystemBE.Deploy.CommonEnumDTO dto) { this.FromDTO(dto,this); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.ForbidUserDTO dto) { base.ToDTO(dto); if (this.UserKey != null) { dto.User = this.UserKey.ID; } dto.StartTime = this.StartTime; dto.EndTime = this.EndTime; this.ToDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.DeviceMapDTO dto) { base.ToDTO(dto); if (this.HouseKey != null) { dto.House = this.HouseKey.ID; } dto.SN = this.SN; if (this.DeviceStatus != null) { dto.DeviceStatus = this.DeviceStatus.EnumValue; } if (this.UseStatus != null) { dto.UseStatus = this.UseStatus.EnumValue; } dto.Price = this.Price; dto.Expression = this.Expression; dto.IsDelete = this.IsDelete; if (this.DeviceKey != null) { dto.Device = this.DeviceKey.ID; } this.ToDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.DeviceRepairRecordDTO dto , THU.LabSystemBE.DeviceRepairRecord entity) { base.FromDTO(dto,entity); if(dto.Device <=0){ entity.DeviceKey = null; } else { entity.DeviceKey = new EntityKey<THU.LabSystemBE.DeviceMap>(dto.Device); } if(dto.User <=0){ entity.UserKey = null; } else { entity.UserKey = new EntityKey<THU.LabSystemBE.User>(dto.User); } if(dto.Teacher <=0){ entity.TeacherKey = null; } else { entity.TeacherKey = new EntityKey<THU.LabSystemBE.Teacher>(dto.Teacher); } entity.ReportDate = dto.ReportDate; entity.IsCompleted = dto.IsCompleted; entity.CompleteDate = dto.CompleteDate; if(dto.CompleteUser <=0){ entity.CompleteUserKey = null; } else { entity.CompleteUserKey = new EntityKey<THU.LabSystemBE.User>(dto.CompleteUser); } entity.Fee = dto.Fee; entity.ReportMemo = dto.ReportMemo; entity.RepairDate = dto.RepairDate; entity.AlarmUser = dto.AlarmUser; if(dto.House <=0){ entity.HouseKey = null; } else { entity.HouseKey = new EntityKey<THU.LabSystemBE.CommonEnum>(dto.House); } entity.RepairMemo = dto.RepairMemo; this.FromDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.TeacherDTO dto) { base.ToDTO(dto); dto.Name = this.Name; if (this.Sex != null) { dto.Sex = this.Sex.EnumValue; } if (this.PositionKey != null) { dto.Position = this.PositionKey.ID; } if (this.DepartmentKey != null) { dto.Department = this.DepartmentKey.ID; } dto.Tag = this.Tag; dto.IsDelete = this.IsDelete; this.ToDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.DeviceUseRecordDTO dto , THU.LabSystemBE.DeviceUseRecord entity) { base.FromDTO(dto,entity); if(dto.Device <=0){ entity.DeviceKey = null; } else { entity.DeviceKey = new EntityKey<THU.LabSystemBE.DeviceMap>(dto.Device); } entity.BeginTime = dto.BeginTime; entity.EndTime = dto.EndTime; entity.Fee = dto.Fee; if(dto.User <=0){ entity.UserKey = null; } else { entity.UserKey = new EntityKey<THU.LabSystemBE.User>(dto.User); } entity.IsAppoint = dto.IsAppoint; if(dto.Teacher <=0){ entity.TeacherKey = null; } else { entity.TeacherKey = new EntityKey<THU.LabSystemBE.Teacher>(dto.Teacher); } entity.IsCompleted = dto.IsCompleted; if(dto.House <=0){ entity.HouseKey = null; } else { entity.HouseKey = new EntityKey<THU.LabSystemBE.CommonEnum>(dto.House); } entity.IsUsing = dto.IsUsing; entity.Price = dto.Price; entity.TotalTime = dto.TotalTime; this.FromDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.TeacherDTO dto , THU.LabSystemBE.Teacher entity) { base.FromDTO(dto,entity); entity.Name = dto.Name; if(dto.Sex > 0) { entity.Sex=(THU.LabSystemBE.SexEnum)dto.Sex; } if(dto.Position <=0){ entity.PositionKey = null; } else { entity.PositionKey = new EntityKey<THU.LabSystemBE.CommonEnum>(dto.Position); } if(dto.Department <=0){ entity.DepartmentKey = null; } else { entity.DepartmentKey = new EntityKey<THU.LabSystemBE.CommonEnum>(dto.Department); } entity.Tag = dto.Tag; entity.IsDelete = dto.IsDelete; this.FromDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.DeviceLogDTO dto , THU.LabSystemBE.DeviceLog entity) { base.FromDTO(dto,entity); if(dto.Device <=0){ entity.DeviceKey = null; } else { entity.DeviceKey = new EntityKey<THU.LabSystemBE.DeviceMap>(dto.Device); } if(dto.Operator <=0){ entity.OperatorKey = null; } else { entity.OperatorKey = new EntityKey<THU.LabSystemBE.User>(dto.Operator); } if(dto.Status > 0) { entity.Status=(THU.LabSystemBE.DeviceStatusEnum)dto.Status; } entity.BizDate = dto.BizDate; this.FromDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.LoginLoggerDTO dto) { base.ToDTO(dto); dto.User = this.User; dto.Name = this.Name; dto.IP = this.IP; dto.Success = this.Success; dto.ErrorMsg = this.ErrorMsg; dto.LoginDate = this.LoginDate; this.ToDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.UserDTO dto , THU.LabSystemBE.User entity) { base.FromDTO(dto,entity); entity.SN = dto.SN; entity.Name = dto.Name; entity.Tel = dto.Tel; entity.Password = dto.Password; if(dto.Degree <=0){ entity.DegreeKey = null; } else { entity.DegreeKey = new EntityKey<THU.LabSystemBE.CommonEnum>(dto.Degree); } if(dto.Status <=0){ entity.StatusKey = null; } else { entity.StatusKey = new EntityKey<THU.LabSystemBE.CommonEnum>(dto.Status); } if(dto.Type > 0) { entity.Type=(THU.LabSystemBE.UserTypeEnum)dto.Type; } entity.Email = dto.Email; entity.Code = dto.Code; entity.IsDelete = dto.IsDelete; entity.BeginTime = dto.BeginTime; entity.EndTime = dto.EndTime; if(dto.Teacher <=0){ entity.TeacherKey = null; } else { entity.TeacherKey = new EntityKey<THU.LabSystemBE.Teacher>(dto.Teacher); } this.FromDTOImpl(dto); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.LoginLoggerDTO dto , THU.LabSystemBE.LoginLogger entity) { base.FromDTO(dto,entity); entity.User = dto.User; entity.Name = dto.Name; entity.IP = dto.IP; entity.Success = dto.Success; entity.ErrorMsg = dto.ErrorMsg; entity.LoginDate = dto.LoginDate; this.FromDTOImpl(dto); }
private THU.LabSystemBE.Deploy.UserDTO TypeConvert(THU.LabSystemBE.Deploy.UserDTO obj) { return obj; }
private THU.LabSystemBE.Deploy.CommonEnumDTO TypeConvert(THU.LabSystemBE.Deploy.CommonEnumDTO obj) { return obj; }
public virtual void FromDTO(THU.LabSystemBE.Deploy.DeviceDTO dto) { this.FromDTO(dto,this); }
protected virtual void FromDTO(THU.LabSystemBE.Deploy.DeviceMapDTO dto , THU.LabSystemBE.DeviceMap entity) { base.FromDTO(dto,entity); if(dto.House <=0){ entity.HouseKey = null; } else { entity.HouseKey = new EntityKey<THU.LabSystemBE.CommonEnum>(dto.House); } entity.SN = dto.SN; if(dto.DeviceStatus > 0) { entity.DeviceStatus=(THU.LabSystemBE.DeviceStatusEnum)dto.DeviceStatus; } if(dto.UseStatus > 0) { entity.UseStatus=(THU.LabSystemBE.UseStatusEnum)dto.UseStatus; } entity.Price = dto.Price; entity.Expression = dto.Expression; entity.IsDelete = dto.IsDelete; if(dto.Device <=0){ entity.DeviceKey = null; } else { entity.DeviceKey = new EntityKey<THU.LabSystemBE.Device>(dto.Device); } this.FromDTOImpl(dto); }
protected virtual void ToDTO(THU.LabSystemBE.Deploy.DeviceDTO dto) { base.ToDTO(dto); dto.Name = this.Name; if (this.Type != null) { dto.Type = this.Type.EnumValue; } dto.Expression = this.Expression; dto.Tag = this.Tag; dto.Price = this.Price; dto.IsDelete = this.IsDelete; this.ToDTOImpl(dto); }
public virtual void FromDTO(THU.LabSystemBE.Deploy.ForbidUserDTO dto) { this.FromDTO(dto,this); }