private void RptBind(string _strWhere, string _orderby) { this.txtKeywords.Text = this.keywords; BLL.app_oauth bll = new BLL.app_oauth(); this.rptList.DataSource = bll.GetList(0, _strWhere, _orderby); this.rptList.DataBind(); }
private void ShowInfo(int _id) { BLL.app_oauth bll = new BLL.app_oauth(); Model.app_oauth model = bll.GetModel(_id); txtTitle.Text = model.title; rblIsLock.SelectedValue = model.is_lock.ToString(); txtSortId.Text = model.sort_id.ToString(); txtApiPath.Text = model.api_path; txtAppId.Text = model.app_id; txtAppKey.Text = model.app_key; txtImgUrl.Text = model.img_url; txtRemark.Text = model.remark; }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("app_oauth", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.app_oauth bll = new BLL.app_oauth(); 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) { bll.Delete(id); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("oauth_list.aspx", "keywords={0}", this.keywords), "Success"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { BLL.app_oauth bll = new BLL.app_oauth(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("oauth_list.aspx", "keywords={0}", this.keywords), "Success"); }
/// <summary> /// 获取OAuth配置信息 /// </summary> /// <param name="oauth_name"></param> public static oauth_config get_config(string oauth_name) { //读取接口配置信息 Model.app_oauth model = new BLL.app_oauth().GetModel(oauth_name); if (model != null) { //读取站点配置信息 Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(HotoKeys.FILE_SITE_XML_CONFING); //赋值 oauth_config config = new oauth_config(); config.oauth_name = model.api_path.Trim(); config.oauth_app_id = model.app_id.Trim(); config.oauth_app_key = model.app_key.Trim(); config.return_uri = HotoUtils.DelLastChar(siteConfig.weburl, "/") + siteConfig.webpath + "api/oauth/" + model.api_path + "/return_url.aspx"; return(config); } return(null); }
/// <summary> /// 获取OAuth配置信息 /// </summary> /// <param name="oauth_name"></param> public static oauth_config get_config(string oauth_name) { //读取接口配置信息 Model.app_oauth model = new BLL.app_oauth().GetModel(oauth_name); if (model != null) { //读取站点配置信息 Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(HotoKeys.FILE_SITE_XML_CONFING); //赋值 oauth_config config = new oauth_config(); config.oauth_name = model.api_path.Trim(); config.oauth_app_id = model.app_id.Trim(); config.oauth_app_key = model.app_key.Trim(); config.return_uri = HotoUtils.DelLastChar(siteConfig.weburl, "/") + siteConfig.webpath + "api/oauth/" + model.api_path + "/return_url.aspx"; return config; } return null; }
private bool DoAdd() { bool result = true; Model.app_oauth model = new Model.app_oauth(); BLL.app_oauth bll = new BLL.app_oauth(); model.title = txtTitle.Text.Trim(); model.is_lock = int.Parse(rblIsLock.SelectedValue); 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.Text.Trim(); model.remark = txtRemark.Text; if (bll.Add(model) < 1) { result = false; } return result; }
private bool DoAdd() { bool result = true; Model.app_oauth model = new Model.app_oauth(); BLL.app_oauth bll = new BLL.app_oauth(); model.title = txtTitle.Text.Trim(); model.is_lock = int.Parse(rblIsLock.SelectedValue); 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.Text.Trim(); model.remark = txtRemark.Text; if (bll.Add(model) < 1) { result = false; } return(result); }