private void DoAddFirst(Control button) { Control _temp = button.NamingContainer; string main_key = (string)this.ViewState["main_key"]; string sub_key = (_temp.FindControl("textbox_sub_key") as TextBox).Text.Trim(); string content = (_temp.FindControl("textbox_content") as TextBox).Text.Trim(); string desc = (_temp.FindControl("textbox_description") as TextBox).Text.Trim(); if (string.IsNullOrEmpty(sub_key)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input sub_key.", _temp.FindControl("textbox_sub_key")); return; } if (string.IsNullOrEmpty(content)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input content", _temp.FindControl("textbox_content")); return; } SysCodeList entity = new SysCodeList(main_key, sub_key); entity.Content = content; entity.Description = desc; CodeBiz.InsertCodeList(entity); this.LoadData(); }
private void DoAddFirst(Control button) { Control _temp = button.NamingContainer; string config_id = (_temp.FindControl("textbox_config_id") as TextBox).Text.Trim(); string config_value = (_temp.FindControl("textbox_config_value") as TextBox).Text.Trim(); if (string.IsNullOrEmpty(config_id)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input config id.", _temp.FindControl("textbox_config_id")); return; } if (string.IsNullOrEmpty(config_value)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input config value", _temp.FindControl("textbox_config_value")); return; } SysConfig entity = new SysConfig(); entity.ConfigId = config_id; entity.ConfigValue = config_value; SysConfigBiz.Insert(entity); this.LoadData(); }
private void DoAddNew(Control button) { Control _temp = button.NamingContainer; string main_key = (_temp.FindControl("textbox_main_key") as TextBox).Text.Trim(); string desc = (_temp.FindControl("textbox_description") as TextBox).Text.Trim(); if (string.IsNullOrEmpty(main_key)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input main_key.", _temp.FindControl("textbox_main_key")); return; } if (string.IsNullOrEmpty(desc)) { ScriptHelper.AjaxAlertFocus(this.UpdatePanel1, "please input description", _temp.FindControl("textbox_description")); return; } SysCodeMaster entity = new SysCodeMaster(); entity.MainKey = main_key; entity.Description = desc; CodeBiz.InsertMaster(entity); this.LoadData(); }
protected void ButtonLogin_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TextBoxUserName.Text)) { ScriptHelper.AjaxAlertFocus(this.ButtonLogin, "Please input user name.", this.TextBoxUserName); return; } if (string.IsNullOrEmpty(TextBoxPassword.Text)) { ScriptHelper.AjaxAlertFocus(this.ButtonLogin, "Please input password.", this.TextBoxPassword); return; } // UserBiz biz = new UserBiz(); SysUserInfo user = UserBiz.Login(TextBoxUserName.Text, TextBoxPassword.Text); if (user != null) { this.Session["user"] = user; Response.Redirect("~/HomePage.aspx"); // ScriptHelper.AjaxAlert(this.ButtonLogin, "Login Ok."); return; } else { ScriptHelper.AjaxAlertSelect(this.ButtonLogin, "User name or password error.", this.TextBoxUserName); return; } }