public ActionResult DeleteConfirmed(int id) { Iuser iuser = db.Iusers.Find(id); db.Iusers.Remove(iuser); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult LogManage() { Iuser user = irep.GetUser(userName); ViewBag.UserName = userName; ViewBag.UserId = user.User_Id; ViewBag.Date = DateTime.Now; return(View()); }
private InteropUser() { Iuser _mgr = (Iuser)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUser, BusinessProcess.Administration"); DataTable dt = _mgr.GetUserByUserName("interop"); if (dt != null && dt.Rows.Count == 1) { _userId = Convert.ToInt32(dt.Rows[0]["UserId"]); } }
// // GET: /search/Details/ public ActionResult Details(int id = 0) { Iuser iuser = db.Iusers.Find(id); if (iuser == null) { return(HttpNotFound()); } return(View(iuser)); }
// // GET: /search/Edit public ActionResult Edit(int id = 0) { Iuser iuser = db.Iusers.Find(id); if (iuser == null) { return(HttpNotFound()); } ViewBag.userId = new SelectList(db.users, "user_id", "name", iuser.userId); return(View(iuser)); }
public ActionResult RoleChoose(string roleName) { if (Session["userName"] == null) { return(RedirectToAction("UserManage", "Home")); } string userName = Session["userName"].ToString(); IRole role = irep.GetRole(roleName); Iuser user = irep.GetUser(userName); irep.AddUserInRoles(user.User_Id, role.Role_Id); return(View("OK")); }
/// <summary> /// Gets the user details. /// </summary> /// <param name="userId">The user identifier.</param> /// <returns></returns> string GetUserDetails(int userId) { try { Iuser userMaster = (Iuser)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUser, BusinessProcess.Administration"); DataSet ds = userMaster.GetUserRecord(userId); return(ds.Tables[0].Rows[0]["UserLastName"].ToString() + ", " + ds.Tables[0].Rows[0]["UserFirstName"].ToString()); } catch (Exception ex) { this.OnErrorOccured(this, new CommandEventArgs("Error", ex)); return(""); } }
private void Init_Form() { try { Iuser UserManager = (Iuser)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUser, BusinessProcess.Administration"); DataSet theDS = UserManager.GetUserList(); MakeGridTable(theDS); } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } }
public ActionResult Edit(Iuser iuser) { var SData = db.Iusers.Add(iuser); SData.userId = (int)Session["j"]; SData.Sitem = iuser.Sitem; SData.Scat = iuser.Scat; SData.Sphone = iuser.Sphone; if (ModelState.IsValid) { db.Entry(SData).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.userId = new SelectList(db.users, "user_id", "name", iuser.userId); return(View(iuser)); }
/// <summary> /// Populates the users list. /// </summary> void PopulateUsersList() { // if (ddWaitingFor.Items.Count > 0) return; DataTable theUserDt; Iuser UManager = (Iuser)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUser, BusinessProcess.Administration"); theUserDt = (UManager.GetUserList()).Tables[0]; DataColumn newColumn; newColumn = new DataColumn("Name"); newColumn.Expression = " UserFirstName +' '+ UserLastName"; theUserDt.Columns.Add(newColumn); //Add system admin who was removed at query level DataRow theAdminRow = theUserDt.NewRow(); theAdminRow.SetField("UserID", 1); theAdminRow.SetField("UserFirstName", "System"); theAdminRow.SetField("UserLastName", "Admin"); theAdminRow.SetField("Status", "Active"); theAdminRow.SetField("Name", "System Admin"); theUserDt.Rows.Add(theAdminRow); DataView dv = theUserDt.DefaultView; dv.RowFilter = "Status = 'Active'"; dv.Sort = "Name Asc"; dv.ToTable("Selected", true, "UserID", "Name"); DataTable theDT = dv.ToTable("Selected", true, "UserID", "Name"); BindFunctions bindFunctions = new BindFunctions(); //bindFunctions.BindCombo(ddWaitingFor, theDT, "Name", "UserID"); //BindUserDropdown(ddWaitingFor, string.Empty); BindUserDropdown(ddWaitingFor, Session["AppUserId"].ToString()); ddWaitingFor.Visible = true; lblWaitingfor.Visible = true; // ddWaitingFor.SelectedValue = base.Session["AppUserId"].ToString(); }
public bool AddUser(Iuser user) { sqlString = "insert into A_User(User_Name,Pwd) values (@userName,@pwd)"; List <Parameter> paraList = new List <Parameter> { new Parameter { ParameterName = "@userName", Value = user.User_Name }, new Parameter { ParameterName = "@pwd", Value = user.Pwd } }; if (sqlData.InsertOrUpdateOrDelete(sqlString, connString, paraList)) { return(true); } else { return(false); } }
public ActionResult Create(Iuser iuser) { var SData = db.Iusers.Add(iuser); SData.Scat = iuser.Scat; SData.Sitem = iuser.Sitem; SData.area = iuser.area; SData.Sphone = iuser.Sphone; SData.userId = (int)Session["ID"]; Session["j"] = SData.userId; if (ModelState.IsValid) { db.Iusers.Add(iuser); db.SaveChanges(); return(Redirect("/Regester/AfterLogin")); } ViewBag.userId = new SelectList(db.users, "user_id", "name", iuser.userId); return(View(iuser)); }
static void Main(string[] args) { //抽象工厂模式 User user = new User(); IFactory factory = new SqlserverFactory(); Iuser ur = factory.CreateUser(); ur.Inser(user); ur.GetUser(""); factory = new AccessFactory(); ur = factory.CreateUser(); ur.Inser(user); ur.GetUser(""); IDepartment dt = factory.CreateDepartment(); dt.Insert(new Department() { Name = "马化腾", ID = "1234567" }); dt.getDepartment(""); ur = DataAccess.CreateUser(); ur.Inser(new User() { Id = "654789", Name = "李彦宏" }); ur.GetUser(""); Console.Read(); }
public UserController(Iuser _user) => _userContext = _user;
public GroupHub(IGroup s, Iuser u, ChatContext context) { _ServerService = s; _UserService = u; _Context = context; }
public userController(Iuser interface_user) { this._iuser = interface_user; }
public Pleb(IHubContext <PlebChat> p, Iuser u) { UserService = u; _hubContext = p; }
/// <summary> /// Public constructor to initialize item service instance /// </summary> public loginController() { _user = new UserService(); }
public PlebChat(Iuser u) { UserService = u; }
public UsersController(Iuser userService) { _userService = userService; }
public UserController(Iuser user) { _user = user; }
public User(Iuser obj) { this.myProperty1 = obj.myProperty1;
public UserController(Iuser user, IquyenSudungChucnang quyensudungchucnang) { this.user = user; this.quyensudungchucnang = quyensudungchucnang; }
public WeatherForecastController(ILogger <WeatherForecastController> logger, Iuser interfaceUser) { _logger = logger; _iuser = interfaceUser; }
public UserController(Iuser user) { this.user = user; }
public HomeController(Iuser iuser, ConnectionStringClass cc) { _iusr = iuser; _cc = cc; }