//创建运费下拉表单 private string CreateFareHtml(DataTable dt) { string selectTlp = "<select name='{0}' class='fare_select'>{1}</select>"; //fare_storeid,optinohtml string optionTlp = "<option data-price='{0}' value='{1}'>{2}</option>"; //price,id,Desc string html = "", result = ""; if (dt.Select("Enabled='true'").Length < 1) { dt.Rows[0]["Enabled"] = true; } foreach (DataRow dr in dt.Rows) { if (!DataConvert.CBool(dr["Enabled"].ToString())) { continue; } dr["Total"] = Convert.ToDouble(dr["Price"]) + Convert.ToDouble(dr["Plus"]); if (Convert.ToDouble(dr["Total"]) == 0) { dr["Desc"] = dr["Name"] + " 免邮"; } else { dr["Desc"] = dr["Name"] + " " + dr["Total"] + "元"; } html += string.Format(optionTlp, dr["Total"], dr["ID"], dr["Desc"]); } result = string.Format(selectTlp, "fare_" + dt.Rows[0]["StoreID"], html); return(result); }
public IActionResult DBScript() { //type source name uname passwd M_APIResult retMod = new M_APIResult(Failed); try { string connStr = GetConnstr(); DBCenter.DB = SqlBase.CreateHelper("mssql"); DBCenter.DB.ConnectionString = SiteConfig.SiteInfo.ConnectionString = connStr; if (!DataConvert.CBool(GetParam("ignoreSql"))) { string sqlPath = function.VToP("/App_Data/Data.sql"); DBHelper.ExecuteSqlScript(GetConnstr(), sqlPath); } SiteConfig.Update(); retMod.retcode = M_APIResult.Success; } catch (Exception ex) { retMod.retmsg = ex.Message; ZLLog.L("安装时出错,原因:" + ex.Message); } return(Content(retMod.ToString())); }
public IActionResult UserConfig_Submit() { SiteConfig.UserConfig.EnableUserReg = DataConvert.CBool(GetParam("EnableUserReg")); SiteConfig.UserConfig.UserValidateType = DataConvert.CBool(GetParam("UserValidateType")); SiteConfig.UserConfig.EmailCheckReg = DataConvert.CBool(RequestEx["EmailCheckReg"]); //obj2.UserConfig.EnableAlipayCheckReg = rdoAlipayCheck.Items[0].Selected;//支付宝 SiteConfig.UserConfig.EmailRegis = DataConvert.CBool(RequestEx["EmailRegis"]); SiteConfig.UserConfig.UserIDlgn = DataConvert.CBool(RequestEx["UserIDlgn"]); //会员ID登录 SiteConfig.UserConfig.MobileReg = DataConvert.CBool(RequestEx["MobileReg"]); //会员手机注册 SiteConfig.UserConfig.MobileCodeNum = DataConverter.CLng(RequestEx["MobileCodeNum"]); //SiteConfig.UserConfig.MobileCodeType = DataConverter.CLng(Request.Form["MobileCodeType"]); SiteConfig.UserConfig.EmailTell = DataConvert.CBool(RequestEx["EmailTell"]); SiteConfig.UserConfig.AdminCheckReg = DataConvert.CBool(RequestEx["AdminCheckReg"]); SiteConfig.UserConfig.EnableCheckCodeOfReg = DataConvert.CBool(RequestEx["EnableCheckCodeOfReg"]); SiteConfig.UserConfig.UserNameLimit = DataConvert.CLng(RequestEx["UserNameLimit"], 3); SiteConfig.UserConfig.UserNameMax = DataConvert.CLng(RequestEx["UserNameMax"], 20); SiteConfig.UserConfig.UserNameRegDisabled = RequestEx["UserNameRegDisabled"]; SiteConfig.UserConfig.EnableCheckCodeOfLogin = Request.Form["EnableCheckCodeOfLogin_rad"]; //SiteConfig.UserConfig.EnableMultiLogin = RadioButtonList7.Checked; SiteConfig.UserConfig.CommentRule = DataConvert.CLng(RequestEx["CommentRule"]); SiteConfig.UserConfig.InfoRule = DataConvert.CLng(RequestEx["InfoRule"]); SiteConfig.UserConfig.RecommandRule = DataConvert.CLng(RequestEx["RecommandRule"]); //obj2.UserConfig.LoginRule = int.Parse(tb_LoginRule.Text.Trim()); //SiteConfig.UserConfig.UserGetPasswordEmail = txtGetPassword.Text; SiteConfig.UserConfig.RegFieldsMustFill = RequestEx["HdnRegFields_MustFill"]; SiteConfig.UserConfig.RegFieldsSelectFill = RequestEx["HdnRegFields_SelectFill"]; //SiteConfig.UserConfig.EmailTellContent = txtEmailTell.Text; SiteConfig.UserConfig.MobileRegInfo = RequestEx["MobileRegInfo"]; //SiteConfig.UserConfig.PointExp = DataConverter.CDouble(TxtCUserExpExchangePoints.Text); //SiteConfig.UserConfig.PointMoney = DataConverter.CDouble(TxtCUserExpExchangeMoney.Text); //SiteConfig.UserConfig.ChangeSilverCoinByExp = DataConverter.CDouble(TxtCUserExpExchangeExp.Text); //SiteConfig.UserConfig.PointSilverCoin = DataConverter.CDouble(TxtCUserExpExchangeSilverCoin.Text); SiteConfig.UserConfig.PresentExp = DataConverter.CDouble(RequestEx["PresentExp"]); SiteConfig.UserConfig.PresentMoney = DataConverter.CDouble(RequestEx["PresentMoney"]); SiteConfig.UserConfig.PresentPoint = DataConverter.CLng(RequestEx["PresentPoint"]); SiteConfig.UserConfig.PresentPointAll = DataConverter.CLng(RequestEx["PresentPointAll"]); SiteConfig.UserConfig.PresentValidNum = DataConverter.CLng(RequestEx["PresentValidNum"]); SiteConfig.UserConfig.PresentValidUnit = DataConverter.CLng(RequestEx["PresentValidUnit"]); SiteConfig.UserConfig.PresentExpPerLogin = DataConverter.CDouble(RequestEx["PresentExpPerLogin"]); SiteConfig.UserConfig.SigninPurse = DataConverter.CDouble(RequestEx["SigninPurse"]); SiteConfig.UserConfig.Integral = DataConverter.CLng(RequestEx["Integral"]); SiteConfig.UserConfig.IntegralPercentage = DataConverter.CDouble(RequestEx["IntegralPercentage"]); //SiteConfig.UserConfig.MoneyExchangePointByMoney = DataConverter.CDouble(TxtMoneyExchangePoint.Text); //SiteConfig.UserConfig.MoneyExchangeValidDayByMoney = DataConverter.CDouble(TxtMoneyExchangeValidDay.Text); //SiteConfig.UserConfig.UserExpExchangePointByExp = DataConverter.CDouble(TxtUserExpExchangePoint.Text); //SiteConfig.UserConfig.UserExpExchangeValidDayByExp = DataConverter.CDouble(TxtUserExpExchangeValidDay.Text); //SiteConfig.UserConfig.MoneyExchangePointByPoint = DataConverter.CDouble(TxtCMoneyExchangePoint.Text); //SiteConfig.UserConfig.MoneyExchangeValidDayByValidDay = DataConverter.CDouble(TxtCMoneyExchangeValidDay.Text); //SiteConfig.UserConfig.UserExpExchangePointByPoint = DataConverter.CDouble(TxtCUserExpExchangePoint.Text); //SiteConfig.UserConfig.UserExpExchangeValidDayByValidDay = DataConverter.CDouble(TxtCUserExpExchangeValidDay.Text); //SiteConfig.UserConfig.MoneyExchangeDummyPurseByDummyPurse = DataConverter.CDouble(txtCMoneyExchangeDummyPurse.Text); //SiteConfig.UserConfig.MoneyExchangeDummyPurseByMoney = DataConverter.CDouble(txtMoneyExchangeDummyPurse.Text); //SiteConfig.UserConfig.PunchType = DataConverter.CLng(selPunch.Value); //SiteConfig.UserConfig.PunchVal = DataConverter.CLng(txtPunch.Text); //SiteConfig.UserConfig.PointName = TxtPointName.Text.Trim(); //SiteConfig.UserConfig.PointUnit = TxtPointUnit.Text.Trim(); //SiteConfig.UserConfig.PromotionType = DataConverter.CLng(RadioButtonList10.SelectedValue); //SiteConfig.UserConfig.Promotion = DataConverter.CLng(txtPromotion.Text); SiteConfig.UserConfig.Reg_EmailMust = DataConvert.CBool(RequestEx["Reg_EmailMust"]); SiteConfig.UserConfig.Reg_AnswerMust = DataConvert.CBool(RequestEx["Reg_AnswerMust"]); SiteConfig.UserConfig.Reg_SelGroup = DataConvert.CBool(RequestEx["Reg_SelGroup"]); //SiteConfig.UserConfig.EmailRegInfo = txtEmailRegInfo.Text.Trim(); //SiteConfig.UserConfig.DisCuzNT = DisCuzNT.Checked; //string regrulelist = ""; //for (int i = 0; i < RegRule.Items.Count; i++) //{ // if (RegRule.Items[i].Selected) // { // regrulelist = regrulelist + RegRule.Items[i].Value; // } // if (i < RegRule.Items.Count - 1) // { // regrulelist = regrulelist + ","; // } //} SiteConfig.UserConfig.RegRule = RequestEx["RegRule"]; SiteConfig.UserConfig.Agreement = RequestEx["Agreement"]; SiteConfig.UserConfig.UserNavBan = Request.Form["UserNavBan"]; //SiteConfig.UserConfig.InviteCodeCount = DataConverter.CLng(InviteCode_T.Text); //SiteConfig.UserConfig.InviteFormat = InviteFormat_T.Text; //SiteConfig.UserConfig.InviteJoinGroup = DataConverter.CLng(InviteJoinGroup_DP.SelectedValue); SiteConfig.UserConfig.WD_Min = DataConverter.CLng(RequestEx["WD_Min"], 1); SiteConfig.UserConfig.WD_Max = DataConverter.CLng(RequestEx["WD_Max"]); SiteConfig.UserConfig.WD_Multi = DataConverter.CLng(RequestEx["WD_Multi"]); SiteConfig.UserConfig.WD_FeePrecent = DataConverter.CLng(RequestEx["WD_FeePrecent"]); SiteConfig.UserConfig.MaximumUser = DataConverter.CLng(RequestEx["MaximumUser"]); SiteConfig.Update(); return(WriteOK("操作成功", "UserConfig")); }
public IActionResult UserInfo_Submit(M_UserInfo model) { M_UserInfo info = buser.SelReturnModel(Mid); M_Uinfo binfo = buser.GetUserBaseByuserid(info.UserID); if (info.IsNull) { return(WriteErr("用户不存在")); } if (!string.IsNullOrEmpty(GetParam("NewPwd"))) { info.UserPwd = StringHelper.MD5(GetParam("NewPwd")); } if (!string.IsNullOrEmpty(GetParam("PayPwd"))) { info.PayPassWord = StringHelper.MD5(GetParam("PayPwd")); } if (string.IsNullOrEmpty(model.Email)) { return(WriteErr("邮箱不能为空")); } if (!info.Email.Equals(model.Email)) { if (buser.IsExist("email", model.Email)) { return(WriteErr("[" + model.Email + "]邮箱已被注册")); } info.Email = model.Email; } info.GroupID = model.GroupID; info.ParentUserID = model.ParentUserID; info.UserFace = GetParam("UserFace_t"); info.HoneyName = model.HoneyName; info.TrueName = model.TrueName; info.ConsumeExp = model.ConsumeExp; info.CompanyName = model.CompanyName; info.CompanyDescribe = model.CompanyDescribe; info.WorkNum = model.WorkNum; info.Question = model.Question; info.Answer = model.Answer; binfo.UserSex = DataConvert.CBool(GetParam("UserSex")); binfo.BirthDay = model.UserBase.BirthDay; binfo.OfficePhone = model.UserBase.OfficePhone; binfo.HomePhone = model.UserBase.HomePhone; binfo.Mobile = model.UserBase.Mobile; binfo.Fax = model.UserBase.Fax; binfo.ZipCode = model.UserBase.ZipCode; binfo.IDCard = model.UserBase.IDCard; binfo.HomePage = model.UserBase.HomePage; binfo.Address = model.UserBase.Address; binfo.QQ = model.UserBase.QQ; binfo.UserFace = info.UserFace; binfo.Sign = model.UserBase.Sign; binfo.Province = GetParam("selprovince"); binfo.City = GetParam("selcity"); binfo.County = GetParam("selcoutry"); if (info.UserID.ToString() == info.ParentUserID) { return(WriteErr("推荐人不能是用户本身")); } buser.UpdateByID(info); if (binfo.UserId < 1) { binfo.UserId = info.UserID; buser.AddBase(binfo); } else { buser.UpdateBase(binfo); } return(WriteOK("操作成功", "UserInfo?ID=" + info.UserID)); /* * * info.VIP = DataConvert.CLng(RequestEx["level_rad"]); * * info.CerificateDeadLine = DataConverter.CDate(txtCerificateDeadLine.Text); * * * */ }
public IActionResult AdminAdd_Submit(M_AdminInfo input) { M_AdminInfo model = new M_AdminInfo(); if (Mid > 0) { model = B_Admin.GetAdminByAdminId(Mid); string pwd = GetParam("pwd").Replace(" ", ""); string pwd2 = GetParam("pwd2").Replace(" ", ""); if (!string.IsNullOrEmpty(pwd)) { if (pwd.Equals(pwd2)) { return(WriteErr("密码与确认密码不匹配")); } if (pwd.Length < 6) { return(WriteErr("密码至少6位")); } } model.AdminPassword = StringHelper.MD5(pwd); } else { model.AdminName = input.AdminName.Replace(" ", ""); model.AdminPassword = input.AdminPassword; model.AdminPassword = StringHelper.MD5(model.AdminPassword); if (input.AdminPassword.Length < 6) { return(WriteErr("密码至少6位")); } } model.RoleList = GetParam("RoleList"); model.AdminTrueName = input.AdminTrueName; model.RandNumber = input.RandNumber; model.DefaultStart = input.DefaultStart; model.EnableMultiLogin = DataConvert.CBool(GetParam("EnableMultiLogin")); model.EnableModifyPassword = DataConvert.CBool(GetParam("EnableModifyPassword")); model.IsLock = DataConvert.CBool(GetParam("IsLock")); model.IsTable = DataConvert.CBool(GetParam("IsTable")); //admin.PubRole = CheckBox1.Checked ? 1 : 0; //admin.StructureID = curmodel_hid.Value; if (model.AdminId > 0) { B_Admin.Update(model); } else { //新增 if (B_Admin.IsExist(model.AdminName)) { return(WriteErr("管理员名已存在")); } model.AdminId = B_Admin.Add(model); if (DataConvert.CBool(GetParam("AddUser_Chk"))) { M_UserInfo mu = buser.NewUserByAdmin(model); } } return(WriteOK("操作成功", "AdminManage")); }
public string GetRequired() { return(DataConvert.CBool(Eval("Required", "")) ? ComRE.Icon_OK : ComRE.Icon_Error); }