コード例 #1
0
        private void ShowInfo(int _id)
        {
            SF.BLL.sf_website   bll   = new SF.BLL.sf_website();
            SF.Model.sf_website model = bll.GetModel(_id);
            txtsitename.Text = model.sitename;
            //txtappid_name.Text = model.appid_name;
            //txtappid_origin_id.Text = model.appid_origin_id;
            //txtweixin_account.Text = model.weixin_account;
            //txtavatar.Text = model.avatar;
            //txtinterface_url.Text = model.interface_url;
            //if(string.IsNullOrEmpty(model.token_value))
            //{
            //    //model.token_value=this.CreateKey(8);
            //}
            //txttoken_value.Text = model.token_value;
            //txtencodingaeskey.Text = model.encodingaeskey;
            //txtappid.Text = model.appid;
            //txtappsecret.Text = model.appsecret;

            //txtpayment_name.Text = model.payment_name;
            //cbstate.Checked = model.state == 1 ? true : false;
            //txtweixin_pay_account.Text = model.weixin_pay_account;
            //txtaccount_pay_key.Text = model.account_pay_key;
            //rblsend_type.SelectedValue = model.send_type.ToString();
            //txtlogo.Text = model.logo;
            //txtdescription.Text = model.description;
        }
コード例 #2
0
        private bool DoAdd()
        {
            bool result = false;

            SF.BLL.sf_website   bll    = new SF.BLL.sf_website();
            SF.Model.sf_website model  = new SF.Model.sf_website();
            ManagerInfo         model1 = (ManagerInfo)Session[DTKeys.SESSION_ADMIN_INFO];

            //model.businessNum = model1.businessNum;
            model.sitename = txtsitename.Text.Trim();
            //model.appid_name = txtappid_name.Text.Trim();
            //model.appid_origin_id = txtappid_origin_id.Text.Trim();
            //model.weixin_account = txtweixin_account.Text.Trim();
            //model.avatar = txtavatar.Text;
            //model.interface_url = txtinterface_url.Text.Trim();
            //model.token_value = txttoken_value.Text.Trim();
            //if (string.IsNullOrEmpty(model.token_value))
            //{
            //    //model.token_value = this.CreateKey(8);
            //}
            //model.encodingaeskey = txtencodingaeskey.Text.Trim();
            //model.appid = txtappid.Text.Trim().Trim();
            //model.appsecret = txtappsecret.Text.Trim();

            //model.payment_name = txtpayment_name.Text;
            ////model.state = cbstate.Checked ? 1 : 0;
            //model.weixin_pay_account = txtweixin_pay_account.Text.Trim();
            //model.account_pay_key = txtaccount_pay_key.Text.Trim();
            //model.send_type = int.Parse(rblsend_type.SelectedValue);
            //model.logo = txtlogo.Text;
            //model.description = txtdescription.Text;

            model.create_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            model.create_user = model1.realname;
            model.mid         = model1.UserId;
            model.wid         = "W" + SFUtils.GetCheckCode(4).ToString() + DateTime.Now.ToString("yyyyMMddHHmmss");
            if (bll.Add(model) > 0)
            {
                //AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加公众服务号:" + model.appid_name); //记录日志
                //1.拷贝默认模板
                CopyTemplate(model.wid);

                //2.增加默认会员类别
                MemberGradeInfo memberGrade = new MemberGradeInfo();
                memberGrade.wid         = model.wid;
                memberGrade.Name        = "普通会员";
                memberGrade.Description = "普通会员";
                memberGrade.IsDefault   = true;
                memberGrade.TranVol     = 999999999.00;
                memberGrade.TranTimes   = 999999999;
                //折扣
                memberGrade.Discount = 100;
                result = MemberHelper.CreateMemberGrade(memberGrade);
            }
            return(result);
        }
コード例 #3
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //验证appid是否重复
            bool repeat = false;

            SF.BLL.sf_website bll = new SF.BLL.sf_website();

            if (action == DTEnums.ActionEnum.Add.ToString())
            {
                //System.Data.DataSet ds = bll.GetList(" appid = '" + txtappid.Text.Trim() + "' ");
                //if (ds.Tables[0].Rows.Count > 0)
                //{
                //    repeat = true;
                //}
            }
            else if (action == DTEnums.ActionEnum.Edit.ToString())
            {
                //System.Data.DataSet ds = bll.GetList(" id <> " + this.id + " and appid = '" + txtappid.Text.Trim() + "' ");
                //if (ds.Tables[0].Rows.Count > 0)
                //{
                //    repeat = true;
                //}
            }

            if (repeat == true)
            {
                JscriptMsg("提示:AppId在系统中重复,<br>请检查您的AppId或者联系官方系统管理员!", string.Empty);
                return;
            }

            if (action == DTEnums.ActionEnum.Edit.ToString()) //修改
            {
                //ChkAdminLevel("app_edit", DTEnums.ActionEnum.Edit.ToString()); //检查权限
                if (!DoEdit(this.id))
                {
                    JscriptMsg("保存过程中发生错误啦!", string.Empty);
                    return;
                }
                JscriptMsg("修改信息成功!", "app_list.aspx");
            }
            else //添加
            {
                //ChkAdminLevel("app_edit", DTEnums.ActionEnum.Add.ToString()); //检查权限

                if (!DoAdd())
                {
                    JscriptMsg("保存过程中发生错误!", string.Empty);
                    return;
                }
                JscriptMsg("添加信息成功!", "app_list.aspx");
            }
        }
コード例 #4
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            //调整AppId时,需要调整的表
            string[]            strTables = null;
            SF.BLL.sf_website   bll       = new SF.BLL.sf_website();
            SF.Model.sf_website model     = bll.GetModel(_id);

            //if (txtappid.Text.Trim().Equals(model.appid) == false)
            //{
            //    //strTables = new string[] { "sf_contract_child", "sf_user_info", "sf_goods_info", "sf_goods_amounts", "sf_goods_cart", "sf_goods_color", "sf_goods_img", "sf_goods_index_pics", "sf_goods_order", "sf_goods_orderdetal", "sf_goods_size", "sf_goods_types", "sf_user_address", "sf_user_bank", "sf_user_withdraw_order", "sf_auto_reply" };
            //}

            model.id       = _id;
            model.sitename = txtsitename.Text.Trim();
            //model.appid_name = txtappid_name.Text;
            //model.appid_origin_id = txtappid_origin_id.Text;
            //model.weixin_account = txtweixin_account.Text;
            //model.avatar = txtavatar.Text;
            //model.interface_url = txtinterface_url.Text;
            //model.token_value = txttoken_value.Text;
            //if (string.IsNullOrEmpty(model.token_value))
            //{
            //    //model.token_value = this.CreateKey(8);
            //}
            //model.encodingaeskey = txtencodingaeskey.Text;
            //model.appid = txtappid.Text.Trim();
            //model.appsecret = txtappsecret.Text;

            //model.payment_name = txtpayment_name.Text;
            ////model.state = cbstate.Checked ? 1 : 0;
            //model.weixin_pay_account = txtweixin_pay_account.Text;
            //model.account_pay_key = txtaccount_pay_key.Text;
            //model.send_type = int.Parse(rblsend_type.SelectedValue);
            //model.logo = txtlogo.Text;
            //model.description = txtdescription.Text;

            if (bll.Update(model, strTables) == true)
            {
                //AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改公众服务号:" + model.appid_name); //记录日志
                result = true;
            }
            return(result);
        }
コード例 #5
0
ファイル: first.aspx.cs プロジェクト: sriramsoftware/wxshop
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[DTKeys.SESSION_APP_INFO] == null)
            {
                Response.Write("<script>parent.location.href='business/frame.aspx';</script>");
                return;
            }


            if (Session[DTKeys.SESSION_ADMIN_INFO] != null)
            {
                ManagerInfo model       = (ManagerInfo)Session[DTKeys.SESSION_ADMIN_INFO];
                string      businessNum = model.businessNum;
                string      appNum      = Session[DTKeys.SESSION_APP_INFO].ToString();
                //businessNum = Session[DTKeys.SESSION_BUSNIESE_NUM].ToString();


                phone_verify  = string.IsNullOrEmpty(model.telephone) == true ? "verify-no" : "verify-pass";
                email_verify  = string.IsNullOrEmpty(model.Email) == true ? "verify-no" : "verify-pass";
                business_name = model.realname;
                SF.Model.sf_website appModel = new SF.BLL.sf_website().GetModel(appNum);
                avatar_url = string.IsNullOrEmpty(appModel.avatar) == false ? appModel.avatar : avatar_url;

                /*
                 * SF.BLL.statistics bll = new SF.BLL.statistics();
                 * total_money = bll.GetAppNumTotalMoney(appNum);
                 * total_orders_count = bll.GetAppNumOrdersCount(appNum);
                 * total_customers_count = bll.GetAppNumCustomersCount(appNum);
                 * total_appid_count = bll.GetBusinessAppIdCount(businessNum);
                 *
                 * today_notices_count = bll.GetAppNumTodayNoticesCount(model.user_name);
                 * today_orders_count = bll.GetAppNumTodayOrdersCount(appNum);
                 * today_customers_count = bll.GetAppNumTodayCustomersCount(appNum);
                 *
                 *
                 * //获取最近10天的每日订单数据
                 * orders_Tendency = GetOrdersTendency(10, appNum);
                 *
                 * open_appList = GetOpenAppList(businessNum);
                 */
            }
        }
コード例 #6
0
        private void RptBind(string _strWhere, string _orderby)
        {
            SF.BLL.sf_website   bll    = new SF.BLL.sf_website();
            System.Data.DataSet dsData = bll.GetList(" mid =  '" + GetAdminInfo().UserId + "'");
            dsData.Tables[0].Columns.Add("index");
            dsData.Tables[0].Columns.Add("index1");
            for (int i = 0; i < dsData.Tables[0].Rows.Count; i++)
            {
                dsData.Tables[0].Rows[i]["index"]  = i;
                dsData.Tables[0].Rows[i]["index1"] = (i + 1);
            }

            this.rptList.DataSource = dsData;
            this.rptList.DataBind();

            //一个账号最多一个网站
            if (dsData.Tables[0].Rows.Count >= 1)
            {
                divAdd.Visible = false;
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.action = DTRequest.GetQueryString("action");
            if (this.action == "setting")
            {
                int id = DTRequest.GetQueryInt("id");

                SF.BLL.sf_website   bll   = new SF.BLL.sf_website();
                SF.Model.sf_website model = bll.GetModel(id);

                Session[DTKeys.SESSION_WEB_ID] = model.wid;
                //Session[DTKeys.SESSION_TEMPLATES_INFO] = model.templatesNum;
                //Response.Write("<script>parent.location.href='/admin/business/index.aspx';</script>");

                Response.Write("<script>parent.location.href='/admin/default.aspx';</script>");
                //Response.Redirect("/admin/business/index.aspx",true);
                Response.End();
                return;
            }

            RptBind("", "id desc");
        }
コード例 #8
0
ファイル: first.aspx.cs プロジェクト: sriramsoftware/wxshop
        /*
         * private string[] GetOrdersTendency(int nday, string appNum)
         * {
         *  //获取最近n天的统计数据
         *  DateTime startday = DateTime.Now.AddDays(-nday);
         *  DateTime endDay = DateTime.Now.AddDays(-1);
         *  string strStartTime = startday.ToString("yyyy-MM-dd") + " 00:00:00.000";
         *  string strEndTime = endDay.ToString("yyyy-MM-dd") + " 23:59:59.999";
         *
         *
         *  BLL.sf_goods_order bll = new BLL.sf_goods_order();
         *  System.Data.DataSet dsOrders = bll.GetList(" isPay = 2 and appNum = '" + appNum + "' and addTime >= '" + strStartTime + "' and addTime <= '" + strEndTime + "' ");
         *
         *  string xAxis = "";
         *  string yAxis = "";
         *  for (int i = 0; i < nday; i++)
         *  {
         *      string strStartTime1 = startday.AddDays(i).ToString("yyyy-MM-dd") + " 00:00:00.000";
         *      string strEndTime1 = startday.AddDays(i).ToString("yyyy-MM-dd") + " 23:59:59.999";
         *      System.Data.DataRow[] rows = dsOrders.Tables[0].Select(" addTime >= '" + strStartTime1 + "' and addTime <= '" + strEndTime1 + "'");
         *      xAxis += "'" + startday.AddDays(i).ToString("MM-dd") + "',";
         *      yAxis += rows.Length + ",";
         *  }
         *
         *  if (xAxis.Length > 0)
         *  {
         *      xAxis = xAxis.Remove(xAxis.Length - 1, 1);
         *      yAxis = yAxis.Remove(yAxis.Length - 1, 1);
         *  }
         *
         *
         *  decimal total_money = 0;
         *  foreach (System.Data.DataRow r in dsOrders.Tables[0].Rows)
         *  {
         *      total_money += decimal.Parse(r["totalMoney"].ToString());
         *  }
         *  string strTotal_money = total_money == 0 ? "0.00" : total_money.ToString();
         *
         *
         *  return new[] { xAxis, yAxis, strTotal_money };
         * }
         */
        private string GetOpenAppList(int mid)
        {
            SF.BLL.sf_website   bll       = new SF.BLL.sf_website();
            System.Data.DataSet dsAppList = bll.GetAppNumListCount(mid);

            System.Text.StringBuilder sbAppList = new System.Text.StringBuilder();
            sbAppList.AppendLine("<div class=\"product-row\">");
            for (int i = 0; i < dsAppList.Tables[0].Rows.Count; i++)
            {
                System.Data.DataRow row = dsAppList.Tables[0].Rows[i];

                //if (i == 0 || i == 3)
                //{
                //}

                sbAppList.AppendLine("<a class=\"product\" href=\"javascript:showAppDetails('" + row["id"] + "')\">");
                sbAppList.AppendLine("    <div class=\"product-name\">");
                sbAppList.AppendLine("        <i class=\"iconfont icon-bos\"></i>");
                sbAppList.AppendLine("        <b>" + row["appid_name"].ToString() + "</b>");
                sbAppList.AppendLine("    </div>");
                sbAppList.AppendLine("    <div class=\"product-spec bos-spec\">");
                sbAppList.AppendLine("        <div class=\"spec-row\">");
                sbAppList.AppendLine("            <span class=\"spec-key\">");
                sbAppList.AppendLine("                <i class=\"iconfont icon-pie\"></i>流量引入");
                sbAppList.AppendLine("            </span>");
                sbAppList.AppendLine("            <span class=\"spec-value bos-value\">" + row["count"].ToString() + "</span>");
                sbAppList.AppendLine("        </div>");
                sbAppList.AppendLine("    </div>");
                sbAppList.AppendLine("</a>");

                //if (i == 2 || i == 4)
                //{
                //}
            }
            sbAppList.AppendLine("</div>");

            return(sbAppList.ToString());
        }
コード例 #9
0
        private void ShowInfo(int _id)
        {
            SF.BLL.sf_website   bll   = new SF.BLL.sf_website();
            SF.Model.sf_website model = bll.GetModel(_id);

            txtappid_name.Text      = model.appid_name;
            txtappid_origin_id.Text = model.appid_origin_id;
            txtweixin_account.Text  = model.weixin_account;
            txtavatar.Text          = model.avatar;
            txtinterface_url.Text   = model.interface_url;
            txttoken_value.Text     = model.token_value;
            txtencodingaeskey.Text  = model.encodingaeskey;
            txtappid.Text           = model.appid;
            txtappsecret.Text       = model.appsecret;

            txtpayment_name.Text       = model.payment_name;
            cbstate.Checked            = model.state == 1 ? true : false;
            txtweixin_pay_account.Text = model.weixin_pay_account;
            txtaccount_pay_key.Text    = model.account_pay_key;
            rblsend_type.SelectedValue = model.send_type.ToString();
            txtlogo.Text        = model.logo;
            txtdescription.Text = model.description;
        }