Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            M_Ucenter ucMod = new M_Ucenter();

            if (Mid > 0)
            {
                ucMod = ucBll.Select(Mid);
            }
            else
            {
                ucMod.Key     = function.GetRandomString(20);
                ucMod.AddTime = DateTime.Now;
            }
            ucMod.Alias   = Alias_T.Text.Trim();
            ucMod.WebSite = StrHelper.UrlDeal(TxtWebSite.Text);
            if (!string.IsNullOrEmpty(DBUName_T.Text) && !string.IsNullOrEmpty(DBPwd_T.Text))
            {
                ucMod.DBUName = DBUName_T.Text;
                ucMod.DBPwd   = DBPwd_T.Text;
            }
            ucMod.UserAuth = Request.Form["userauth"];
            ucMod.AskAuth  = Request.Form["askauth"];
            //ucMod.ConAuth = "";
            //ucMod.OtherAuth = "";
            ucMod.Status = Status_Chk.Checked ? 1 : 0;
            if (Mid > 0)
            {
                ucBll.Update(ucMod);
            }
            else
            {
                ucBll.Insert(ucMod);
            }
            function.WriteSuccessMsg("操作成功", "WsApi.aspx");
        }
Ejemplo n.º 2
0
 private M_Ucenter CheckKey(string key)//稍后增加5分钟一次的缓存
 {
     ucMod = ucBll.SelByKey(key);
     if (ucMod != null)
     {
         connstr = string.Format(connstr, ucMod.DBUName, ucMod.DBPwd);
     }
     return(ucMod);
 }
Ejemplo n.º 3
0
    public int AddAsk(string key, M_Ask askMod)
    {
        M_Ucenter ucMod = CheckKey(key); if (ucMod == null)

        {
            return(0);
        }

        return(askBll.insert(askMod));
    }
Ejemplo n.º 4
0
    public bool Del(string key, string tbname, string where, SqlParameter[] sp = null)
    {
        M_Ucenter ucMod = CheckKey(key); if (ucMod == null)
        {
            return(false);
        }
        string sql = "DELETE FROM " + tbname + " WHERE " + where;

        return(SqlHelper.ExecuteNonQuery(connstr, CommandType.Text, sql, sp) > 0);
    }
Ejemplo n.º 5
0
        protected void Repeater1_ItemCommand(object sender, RepeaterCommandEventArgs e)
        {
            int id = DataConverter.CLng(e.CommandArgument);

            model = bll.Select(id);
            if (e.CommandName == "Edit")
            {
                Response.Redirect("AddUcenter.aspx?ID=" + id);
            }
            if (e.CommandName == "Delete")
            {
                bll.Del(id);
                function.WriteSuccessMsg("删除成功!", "Ucenter.aspx");
            }
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Admin.IsSuperManage();
     if (!IsPostBack)
     {
         if (Mid > 0)
         {
             M_Ucenter ucMod = ucBll.Select(Mid);
             Alias_T.Text       = ucMod.Alias;
             TxtWebSite.Text    = ucMod.WebSite;
             DBUName_T.Text     = ucMod.DBUName;
             Key_L.Text         = ucMod.Key;
             Status_Chk.Checked = ucMod.Status == 1 ? true : false;
             function.Script(this, "SetChkVal('userauth','" + ucMod.UserAuth + "');");
             function.Script(this, "SetChkVal('askauth','" + ucMod.AskAuth + "');");
             lblText.Text = "修改";
         }
         Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + CustomerPageAction.customPath2 + "user/UserManage.aspx'>用户管理</a><li><a href='WsApi.aspx'>跨站接入</a></li><li>添加授权网站</li>");
     }
 }
Ejemplo n.º 7
0
 public bool Update(M_Ucenter model)
 {
     return(UpdateMapByMid(model));
 }
Ejemplo n.º 8
0
 public int Add(M_Ucenter model)
 {
     return(Insert(model));
 }
Ejemplo n.º 9
0
 public int Insert(M_Ucenter model)
 {
     return(DBCenter.Insert(model));
 }
Ejemplo n.º 10
0
 public bool UpdateMapByMid(M_Ucenter model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
Ejemplo n.º 11
0
 public int Insert(M_Ucenter model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 12
0
 public bool UpdateMapByMid(M_Ucenter model)
 {
     return(Sql.UpdateByID(strTableName, "ID", model.ID, BLLCommon.GetFieldAndPara(model), model.GetParameters()));
 }