private bool DoEdit(int _id) { bool result = false; Cms.BLL.C_user_oauth_app bll = new Cms.BLL.C_user_oauth_app(); Cms.Model.C_user_oauth_app model = bll.GetModel(_id); model.title = txtTitle.Text.Trim(); if (cbIsLock.Checked == true) { model.is_lock = 0; } else { model.is_lock = 1; } model.sort_id = int.Parse(txtSortId.Text.Trim()); model.api_path = txtApiPath.Text.Trim(); model.app_id = txtAppId.Text.Trim(); model.app_key = txtAppKey.Text.Trim(); model.img_url = txtImgUrl.Value.Trim(); model.remark = txtRemark.Text; if (bll.Update(model)) { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), model.title); //记录日志 result = true; } return(result); }
protected void btnDelete_Click(object sender, EventArgs e) { int sucCount = 0; int errorCount = 0; Cms.BLL.C_user_oauth_app bll = new Cms.BLL.C_user_oauth_app(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), bll.GetModel(id).title); //记录日志 if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("oauth_app_list.aspx", "keywords={0}", this.keywords), "Success"); }
private void ShowInfo(int _id) { Cms.BLL.C_user_oauth_app bll = new Cms.BLL.C_user_oauth_app(); Cms.Model.C_user_oauth_app model = bll.GetModel(_id); txtTitle.Text = model.title; if (model.is_lock == 0) { cbIsLock.Checked = true; } else { cbIsLock.Checked = false; } txtSortId.Text = model.sort_id.ToString(); txtApiPath.Text = model.api_path; txtAppId.Text = model.app_id; txtAppKey.Text = model.app_key; txtImgUrl.Value = model.img_url; txtRemark.Text = model.remark; }