private void ShowInfo(int _id) { Rain.Model.user_oauth_app model = new Rain.BLL.user_oauth_app().GetModel(_id); this.txtTitle.Text = model.title; this.cbIsLock.Checked = model.is_lock == 0; this.txtSortId.Text = model.sort_id.ToString(); this.txtApiPath.Text = model.api_path; this.txtAppId.Text = model.app_id; this.txtAppKey.Text = model.app_key; this.txtImgUrl.Text = model.img_url; this.txtRemark.Text = model.remark; }
public static oauth_config get_config(string oauth_name) { Rain.Model.user_oauth_app model = new Rain.BLL.user_oauth_app().GetModel(oauth_name); if (model == null) { return((oauth_config)null); } Rain.Model.siteconfig siteconfig = new Rain.BLL.siteconfig().loadConfig(); return(new oauth_config() { oauth_name = model.api_path.Trim(), oauth_app_id = model.app_id.Trim(), oauth_app_key = model.app_key.Trim(), return_uri = "http://" + HttpContext.Current.Request.Url.Authority.ToLower() + siteconfig.webpath + "api/oauth/" + model.api_path + "/return_url.aspx" }); }
private bool DoEdit(int _id) { bool flag = false; Rain.BLL.user_oauth_app userOauthApp = new Rain.BLL.user_oauth_app(); Rain.Model.user_oauth_app model = userOauthApp.GetModel(_id); model.title = this.txtTitle.Text.Trim(); model.is_lock = !this.cbIsLock.Checked ? 1 : 0; model.sort_id = Utils.StrToInt(this.txtSortId.Text.Trim(), 99); model.api_path = this.txtApiPath.Text.Trim(); model.app_id = this.txtAppId.Text.Trim(); model.app_key = this.txtAppKey.Text.Trim(); model.img_url = this.txtImgUrl.Text.Trim(); model.remark = this.txtRemark.Text; if (userOauthApp.Update(model)) { this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改OAuth信息:" + model.title); flag = true; } return(flag); }