protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GridBind(); //用户信息 MojoCube.Web.User.List list = new MojoCube.Web.User.List(); list.GetData(int.Parse(Session["UserID"].ToString())); lblFullName.Text = list.FullName; txtName.Text = list.UserName; txtPhone1.Text = list.Phone1; txtNickName.Text = list.NickName; txtFullName.Text = list.FullName; txtEmail1.Text = list.Email1; txtAddress1.Text = list.Address1; txtEducation.Text = list.Education; txtSchool.Text = list.School; txtBankAccount.Text = list.BankAccount; txtIDNumber.Text = list.IDNumber; txtBirthday.Text = DateTime.Parse(list.Birthday).ToString("yyyy-MM-dd"); txtNote.Text = list.Note; MojoCube.Web.Sql.ddlFindByValue(ddlSkin, list.Skin); MojoCube.Web.Sql.ddlFindByValue(ddlSex, list.Sex.ToString()); if (list.ImagePath1 != "") { imgPortrait.ImageUrl = "~/Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(list.ImagePath1) + "&cut=200,200"; } else { imgPortrait.ImageUrl = "~/Images/user.png"; } //职位 MojoCube.Web.User.Position position = new MojoCube.Web.User.Position(); position.GetData(list.Position); lblPosition.Text = position.Title; //部门 MojoCube.Web.User.Department department = new MojoCube.Web.User.Department(); department.GetData(list.fk_Department); lblDepartment.Text = department.DepartmentName; lblEducation.Text = list.School + " " + list.Education; lblPhone.Text = list.Phone1; lblAddress.Text = list.Address1; lblNote.Text = list.Note; this.Title = "用户面板"; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { MojoCube.Web.User.Position position = new MojoCube.Web.User.Position(); int index = Convert.ToInt32(e.CommandArgument); //删除 if (e.CommandName == "_delete") { position.DeleteData(int.Parse(((Label)GridView1.Rows[index].FindControl("lblID")).Text)); } GridBind(); }
protected void btnSave_Click(object sender, EventArgs e) { if (txtName.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写名称"); return; } MojoCube.Web.User.Position position = new MojoCube.Web.User.Position(); //修改 if (ViewState["pk_Position"] != null) { position.GetData(int.Parse(ViewState["pk_Position"].ToString())); position.Title = txtName.Text.Trim(); position.LevelID = MojoCube.Web.String.ToInt(txtLevelID.Text.Trim()); position.ModifyUser = int.Parse(Session["UserID"].ToString()); position.ModifyDate = DateTime.Now.ToString(); position.UpdateData(position.pk_Position); } //新增 else { position.Title = txtName.Text.Trim(); position.ParentID = 0; position.LevelID = MojoCube.Web.String.ToInt(txtLevelID.Text.Trim()); position.SortID = 0; position.fk_Company = 0; position.CreateUser = int.Parse(Session["UserID"].ToString()); position.CreateDate = DateTime.Now.ToString(); position.ModifyUser = 0; position.ModifyDate = DateTime.Now.ToString(); position.InsertData(); } Response.Redirect("Position.aspx?active=" + Request.QueryString["active"]); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hlBack.NavigateUrl = "Position.aspx?active=" + Request.QueryString["active"]; if (Request.QueryString["id"] != null) { ViewState["pk_Position"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["id"]); MojoCube.Web.User.Position position = new MojoCube.Web.User.Position(); position.GetData(int.Parse(ViewState["pk_Position"].ToString())); txtName.Text = position.Title; txtLevelID.Text = position.LevelID.ToString(); this.Title = "职位编辑:" + txtName.Text.Trim(); } else { this.Title = "职位编辑"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (this.Page.Title != "") { MojoCube.Web.User.Log.AddLog(this.Page.Title); } //用户信息 MojoCube.Web.User.List user = new MojoCube.Web.User.List(); user.GetData(int.Parse(Session["UserID"].ToString())); LeftMenu.InnerHtml = CreateLeftMenu(); MyHistory.InnerHtml = CreateHistory(user.ShowHistory); lblYear.Text = DateTime.Now.Year.ToString(); hlCopyright.NavigateUrl = "http://www.mojocube.com/"; hlCopyright.Text = "MojoCube"; hlCopyright.Target = "_blank"; Welcome.InnerHtml = DateTime.Now.ToString("yyyy年MM月dd日") + ", " + MojoCube.Api.Date.Get.ChineseWeek(); ViewState["Skin"] = user.Skin; lblFullName1.Text = lblFullName2.Text = user.FullName; if (user.ImagePath1 != "") { imgPortrait1.ImageUrl = imgPortrait2.ImageUrl = imgPortrait3.ImageUrl = "~/Admin/Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(user.ImagePath1); } else { imgPortrait1.ImageUrl = imgPortrait2.ImageUrl = imgPortrait3.ImageUrl = "~/Admin/Images/user.png"; } //职位 MojoCube.Web.User.Position position = new MojoCube.Web.User.Position(); position.GetData(user.Position); lblPosition.Text = position.Title; //部门 MojoCube.Web.User.Department department = new MojoCube.Web.User.Department(); department.GetData(user.fk_Department); lblDepartment.Text = department.DepartmentName; //角色 MojoCube.Web.Role.Name role = new MojoCube.Web.Role.Name(); role.GetData(user.RoleValue); lblRoleName.Text = role.RoleName_CHS; } this.Page.Title = "MojoCube"; //界面皮肤 if (ViewState["Skin"] != null) { skin = ViewState["Skin"].ToString(); } else { skin = "blue"; } skinCss = "<link rel=\"stylesheet\" href=\"../Skins/dist/css/skins/skin-" + skin + ".min.css\" /><link rel=\"stylesheet\" href=\"../Skins/plugins/iCheck/flat/" + skin + ".css\" />"; }