예제 #1
0
        private bool DoAdd(int user_id)
        {
            Model.buyersite_config model = new Model.buyersite_config();
            BLL.buyersite_config   bll   = new BLL.buyersite_config();

            model.user_id     = user_id;
            model.site_type   = 1;
            model.site_name   = txtSiteName.Text.Trim();
            model.site_domain = txtSiteDomain.Text.Trim();
            model.site_config = txtSiteConfig.Text.Trim();
            model.add_time    = DateTime.Now;
            model.update_time = DateTime.Now;
            model.stat        = cbIsLock.Checked == true ? 1 : 4;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加站点:" + model.site_name); //记录日志
                if (bid > 0)
                {
                    new BLL.buyersite().AppliedCrement(bid, true);
                }
                return(true);
            }
            return(false);
        }
예제 #2
0
        private void ShowInfo(int _id)
        {
            if (_id < 1)
            {
                return;
            }

            BLL.buyersite_config bll = new BLL.buyersite_config();
            var ds = bll.GetList(" id=" + _id.ToString());

            if (ds.Tables[0].Rows.Count == 0)
            {
                return;
            }

            DataRow dr = ds.Tables[0].Rows[0];

            cbIsLock.Checked = dr["stat"].ToString() == "1" ? true : false;

            txtSiteName.Text   = dr["site_name"].ToString();
            txtSiteDomain.Text = dr["site_domain"].ToString();
            txtSiteConfig.Text = dr["site_config"].ToString();
            var bu = new BLL.users().GetModel(Convert.ToInt32(dr["user_id"].ToString()));

            txtUserName.Text = bu == null ? "" : bu.user_name;
        }
예제 #3
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page        = DTRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.buyersite_config bll = new BLL.buyersite_config();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("configlist.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
예제 #4
0
        public void ProcessRequest(HttpContext context)
        {
            this.Response = context.Response;

            context.Response.ContentType = "text/plain";
            this.CallBackFun             = DTRequest.GetQueryString("callback");

            if (!new ManagePage().IsAdminLogin())
            {
                EchoErr("尚未登录或已超时,请登录后操作!");
                return;
            }


            string action = DTRequest.GetQueryString("action");

            var bsc = new BLL.buyersite_config().GetList(" id=1");

            if (bsc == null)
            {
                return;
            }
            if (bsc.Tables.Count == 0)
            {
                return;
            }
            if (bsc.Tables[0].Rows.Count == 0)
            {
                return;
            }

            List <string> jXml = new List <string>();

            for (int i = 0; i < bsc.Tables[0].Columns.Count; i++)
            {
                jXml.Add("\"" + bsc.Tables[0].Columns[i].ColumnName + "\":\"" + bsc.Tables[0].Rows[0][i].ToString() + "\"");
            }

            EchoOk(new { site = 1, xml = "{" + string.Join(",", jXml) + "}" });
        }
예제 #5
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.buyersite_config   bll   = new BLL.buyersite_config();
            Model.buyersite_config model = new Model.buyersite_config()
            {
                id          = _id,
                site_name   = txtSiteName.Text.Trim(),
                site_domain = txtSiteDomain.Text.Trim(),
                site_config = txtSiteConfig.Text.Trim(),
                update_time = DateTime.Now,
                stat        = cbIsLock.Checked == true ? 1 : 4
            };

            if (bll.Update(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改站点:" + model.site_name); //记录日志
                result = true;
            }

            return(result);
        }