/// <summary> /// 根据用户ID删除用户 /// </summary> /// <param name="userId"></param> private void DeleteUserInfo(int userId) { if (userInfoBll.Delete(userId)) { ScriptHelper.AlertRefresh("删除成功"); } else { ScriptHelper.Alert("删除失败"); } }
/// <summary> /// 删除分类与所有子分类 /// </summary> /// <param name="categoryId"></param> private void DeleteCategory(int categoryId) { if (bllCategory.DeleteCategory(categoryId)) { ScriptHelper.AlertRefresh("删除成功"); } else { ScriptHelper.AlertRefresh("删除失败"); } }
public void AddOperator(Operator model) { if (!ModelState.IsValid) { ViewBag.ErrorMsg = "请输入正确信息"; return; } if (bllOperator.IsExisteUserName(model.OperatName)) { ScriptHelper.AlertRefresh("已存在的用户名!"); return; } if (bllOperator.AddModel(model)) { ScriptHelper.AlertRefresh("注册成功!"); return; } else { ScriptHelper.Alert("注册失败!"); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { int configId = 0; if (ViewState["ConfigId"] != null) { //修改 configId = Convert.ToInt32(ViewState["ConfigId"]); } oyxf.Model.Config config = new Model.Config(); config.ConfigId = configId; config.Copyright = txtCopyright.Text; config.AboutImgUrl = txtAboutImgUrl.Text; config.AboutIntro = txtAboutIntro.Text; config.AboutUrl = txtAboutUrl.Text; config.NewsUrl = txtNewsUrl.Text; config.ContactImgUrl = txtContactImgUrl.Text; config.ContactUrl = txtContactUrl.Text; config.CompanyName = txtCompanyName.Text; config.Address = txtAddress.Text; config.Postcode = Convert.ToInt32(txtPostcode.Text); config.Telephone = txtTelephone.Text; config.Website = txtWebsite.Text; config.Email = txtEmail.Text; config.ProductUrl = txtProductUrl.Text; if (bllConfig.Update(config)) { ScriptHelper.AlertRefresh("保存成功"); } else { ScriptHelper.Alert("保存失败"); } }