Exemple #1
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);
        }