/// <summary> /// 綁定數據 /// </summary> private void DataBind() { //txtPersoncode.ReadOnly = true; txtPersoncode.Attributes.Add("readonly", "true"); //txtCname.ReadOnly = true; txtCname.Attributes.Add("readonly", "true"); //txtCompanyId.ReadOnly = true; txtCompanyId.Attributes.Add("readonly", "true"); //txtDepCode.ReadOnly = true; txtDepCode.Attributes.Add("readonly", "true"); //txtRoleCode.ReadOnly = true; txtRoleCode.Attributes.Add("readonly", "true"); //txtLanguage.ReadOnly = true; txtLanguage.Attributes.Add("readonly", "true"); //txtDepLevel.ReadOnly = true; txtDepLevel.Attributes.Add("readonly", "true"); //txtIfAdmin.ReadOnly = true; txtIfAdmin.Attributes.Add("readonly", "true"); //txtTel.ReadOnly = true; txtTel.Attributes.Add("readonly", "true"); //txtMail.ReadOnly = true; txtMail.Attributes.Add("readonly", "true"); btnSave.Attributes.Add("disabled", "true"); btnCancel.Attributes.Add("disabled", "true"); PersonBll bll = new PersonBll(); PersonModel model = new PersonModel(); DataTable dt = bll.GetPerson(model, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep); pager.RecordCount = totalCount; dt_global = bll.GetPerson(model, base.SqlDep); ; this.UltraWebGridPerson.DataSource = dt; this.UltraWebGridPerson.DataBind(); pager.TextAfterPageIndexBox = "/" + pager.PageCount.ToString(); }
protected void pager_PageChanged(object sender, EventArgs e) { if (hidOperate.Value == "condition") { PersonBll bll = new PersonBll(); DataTable dt = bll.GetPerson(model_global, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep); pager.RecordCount = totalCount; dt_global = bll.GetPerson(model_global, base.SqlDep); ; DataBind(dt); } else { PersonBll bll = new PersonBll(); PersonModel model = new PersonModel(); DataTable dt = bll.GetPerson(model, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep); pager.RecordCount = totalCount; dt_global = bll.GetPerson(model, base.SqlDep); ; DataBind(dt); } }
protected void Page_Load(object sender, EventArgs e) { Session["personcode"] = ""; pager.CurrentPageIndex = 1; HiddenModuleCode.Value = Request.QueryString["ModuleCode"].ToString(); //PageHelper.ButtonControls(base.FuncList, pnlShowPanel.Controls, base.FuncListModule); if (ClientMessage == null) { ClientMessage = new Dictionary<string, string>(); ClientMessage.Add("DeleteConfirm", Message.DeleteConfirm); ClientMessage.Add("SaveConfim", Message.SaveConfim); ClientMessage.Add("DataExist", Message.DataExist); ClientMessage.Add("PersoncodeNotNull", Message.PersoncodeNotNull); ClientMessage.Add("CnameNotNull", Message.CnameNotNull); ClientMessage.Add("CompanyIdNotNull", Message.CompanyIdNotNull); ClientMessage.Add("RolesCodeNotNull", Message.RolesCodeNotNull); ClientMessage.Add("DepCodeNotNull", Message.DepCodeNotNull); ClientMessage.Add("LanguageNotNull", Message.LanguageNotNull); ClientMessage.Add("IfAdminNotNull", Message.IfAdminNotNull); ClientMessage.Add("AtLastOneChoose", Message.AtLastOneChoose); } string clientmsg = JsSerializer.Serialize(ClientMessage); Page.ClientScript.RegisterStartupScript(GetType(), "ClientMessage", "var Message=" + clientmsg + ";", true); if (!IsPostBack) { HiddenPersonCode.Value = CurrentUserInfo.Personcode; logmodel.ProcessOwner = CurrentUserInfo.Personcode; logmodel.TransactionType = Request.QueryString["ModuleCode"].ToString(); logmodel.LevelNo = "2"; logmodel.FromHost = Request.UserHostAddress; PersonBll bll = new PersonBll(); PersonModel model = new PersonModel(); DataTable tempTable = bll.GetPerson(model, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep); pager.RecordCount = totalCount; dt_global = bll.GetPerson(model, base.SqlDep); pager.TextAfterPageIndexBox = "/" + pager.PageCount.ToString(); DataBind(tempTable); SetSelector(imgCompanyId, txtCompanyId, txtCompanyName, "CompanyId", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgRolCode, txtRoleCode, txtRolesName, "RoleCode", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgDepLevel, txtDepLevel, txtLevelName, "DepLevel", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgLanguage, txtLanguage, txtLanguageName, "Language", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgAdmini, txtIfAdmin, txtAdminName, "IfAdmin", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgDePCode, txtDepCode, txtDepName, "DepCode", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgUserChangePwd, txtUserChangePwd, txtUserChangePwdName, "UserChangePwd", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgUserStartPwd, txtUserStartPwd, txtUserStartPwdName, "UserStartPwd", Request.QueryString["ModuleCode"].ToString()); SetSelector(imegSalaryLogonEnable, txtSalaryLogonEnable, txtSalaryLogonEnableName, "SalaryLogonEnable", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgIpControlFlag, txtIpControlFlag, txtIpControlFlagName, "IpControlFlag", Request.QueryString["ModuleCode"].ToString()); SetSelector(imgEmpType, txtEmpType, txtEmpTypeName, "EmpType", Request.QueryString["ModuleCode"].ToString()); } }
protected void btnQuery_Click(object sender, EventArgs e) { pager.CurrentPageIndex = 1; if (hidOperate.Value == "condition") { model_global = GetModel(); PersonBll bll = new PersonBll(); DataTable dt = bll.GetPerson(model_global, pager.CurrentPageIndex, pager.PageSize, out totalCount, base.SqlDep); pager.RecordCount = totalCount; dt_global = bll.GetPerson(model_global, base.SqlDep); ; DataBind(dt); } }