public static void SaveCustomerSetting(Model.CustomerSetting customerSetting) { IDataCommand dataCommand = DataCommandManager.GetCommand("Customer_SaveCustomerSetting"); dataCommand.SetParameter("@CustomerSysNo", customerSetting.CustomerSysNo); dataCommand.SetParameter("@Setting", customerSetting.Setting); dataCommand.ExecuteNonQuery(); customerSetting.SysNo = Convert.ToInt32(dataCommand.Parameters["@SysNo"].Value); }
public string CreateTask(Model.Task task) { if (task.Setting == null) { return("非法操作,没有可用设置!"); } Model.CustomerSetting setting = task.Setting; BLL.CustomerSettingBLL.SaveCustomerSetting(setting); int result = BLL.TaskBLL.CreateTask(task); string content = string.Empty; return(content); }
public SysParameter() { string cc_WebSetting = "WebSetting"; string cc_CustomerSetting = "CustomerSetting"; string cc_ThumbnailsSetting = "ThumbnailsSetting"; string cc_ShopSetting = "ShopSetting"; #region 系统参数设置 object objWebSetting = GetObject(cc_WebSetting); Model.WebSetting wsmodel = null; if (objWebSetting != null) { wsmodel = (Model.WebSetting)objWebSetting; } else { BLL.WebSetting wsbll = new BLL.WebSetting(); wsmodel = wsbll.GetModel(); SetObject(cc_WebSetting, wsmodel); } if (wsmodel != null) { imageSize = wsmodel.Filesize; _isopensite = wsmodel.CloseWebSite == 1 ? true : false; _isopenshops = wsmodel.CloseShop == 1 ? true : false; _isopenbbs = wsmodel.CloseBBS == 1 ? true : false; _sitehttp = wsmodel.WebSiteDomain; _dummypath = wsmodel.WebSitePath; _websitename = wsmodel.WebSiteName; _websitetitle = wsmodel.WebSiteTitle; _websitedescription = wsmodel.MeteInfo; _websitekey = wsmodel.MeteKey; _websitetemplatepath = wsmodel.TmplatePath; _websitelogo = wsmodel.LogoPath; _websitebanner = wsmodel.BannerPath; _isrewrite = wsmodel.PublicMethod == 0 ? true : false; _staticpagefiletype = wsmodel.StaticPageFileType; _isclosestation = wsmodel.CloseStation == 1 ? true : false; _sitetel = wsmodel.Tel; _sitefax = wsmodel.Fax; _siteemail = wsmodel.Email; _copyright = wsmodel.CopyRight; _issession = wsmodel.LoginMothod == 0 ? true : false; _colecsitedescription = wsmodel.CloseWebSiteInfo; _statisticalCode = wsmodel.Statisticscode; } #endregion #region 用户参数设置 object objCustomerSetting = GetObject(cc_CustomerSetting); Model.CustomerSetting csmodel = null; if (objCustomerSetting != null) { csmodel = (Model.CustomerSetting)objCustomerSetting; } else { BLL.CustomerSetting csbll = new BLL.CustomerSetting(); csmodel = csbll.GetModel(); SetObject(cc_CustomerSetting, csmodel); } if (csmodel != null) { _isregistered = csmodel.AllowRegister.Trim() == "1" ? true : false; _sameemailregister = csmodel.SameEmailRegister == 1 ? true : false; _adminvalidate = csmodel.AdminValidate == 1 ? true : false; _emailvalidate = csmodel.EmailValidate == 1 ? true : false; _emailvalidatecontent = csmodel.EmailValidateContent.Trim(); _handselcoupons = csmodel.HandselCoupons == 1 ? true : false; _handselcouponsnumber = Convert.ToInt32(csmodel.HandselCouponsNumber); _handselcouponsbegintime = Convert.ToDateTime(csmodel.HandselCouponsBeginTime); _handselcouponsendtime = Convert.ToDateTime(csmodel.HandselCouponsEndTime); _handselpoint = csmodel.HandselPoint; _forbiduserid = csmodel.ForbidUserId; _userdefaultgroup = csmodel.UserDefaultGroup; _loginpoint = Convert.ToDecimal(csmodel.LoginPoint); _isloginvalidate = csmodel.LoginIsNeedCheckCode == 1 ? true : false; _ismultilogin = csmodel.AllowOtherLogin == 1 ? true : false; } #endregion #region 缩略图参数设置 object objThumbnailsSetting = GetObject(cc_ThumbnailsSetting); Model.ThumbnailsSetting tsmodel = null; if (objThumbnailsSetting != null) { tsmodel = (Model.ThumbnailsSetting)objThumbnailsSetting; } else { BLL.ThumbnailsSetting tsbll = new BLL.ThumbnailsSetting(); tsmodel = tsbll.GetModel(); SetObject(cc_ThumbnailsSetting, tsmodel); } if (tsmodel != null) { _thumbnailsheight = Convert.ToInt32(tsmodel.ThumbnailsHeight); _thumbnailswidth = Convert.ToInt32(tsmodel.ThumbnailsWidth); _imagesthumbnailsheight = Convert.ToInt32(tsmodel.ImageHeight); _imagesthumbnailswidth = Convert.ToInt32(tsmodel.ImageWidth); _imagewatermarktransparent = Convert.ToInt32(tsmodel.ImgTransparent); _textwatermarktransparent = Convert.ToInt32(tsmodel.CharTransparent); _watermarktext = tsmodel.Characters; _watermarkimage = tsmodel.WatermarkPicturePath; _watermarkposition = tsmodel.WatermarkPosition; _textorimageswatermark = tsmodel.Type; } #endregion #region 商铺参数设置 object objShopSetting = GetObject(cc_ShopSetting); Model.ShopSetting ssmodel = null; if (objShopSetting != null) { ssmodel = (Model.ShopSetting)objShopSetting; } else { BLL.ShopSetting ssbll = new BLL.ShopSetting(); ssmodel = ssbll.GetModel(); SetObject(cc_ShopSetting, ssmodel); } if (ssmodel != null) { _isthumbnails = ssmodel.Thumbnails == 1 ? true : false; _iswatermark = ssmodel.WaterMark == 1 ? true : false; _allowgroupbuydeposit = ssmodel.AllowGroupbuyDeposit == 1 ? true : false; _allowauctiondeposit = ssmodel.AllowAuctionDeposit == 1 ? true : false; _ispaymentweboperation = ssmodel.OrdersReceive == 1 ? true : false; _ordersText = ssmodel.OrdersText; } #endregion }
public string SaveCustomerSetting(Model.CustomerSetting customerSetting) { int result = CustomerSettingBLL.SaveCustomerSetting(customerSetting); return(string.Empty); }
public static Model.CustomerSetting GetCustomerSetting(int customerSysNo) { Model.CustomerSetting setting = CustomerSettingDAL.GetCustomerSetting(customerSysNo); return(setting); }
public static int SaveCustomerSetting(Model.CustomerSetting customerSetting) { CustomerSettingDAL.SaveCustomerSetting(customerSetting); return(1); }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.CustomerSetting GetModel() { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 SID,AllowRegister,SameEmailRegister,AdminValidate,EmailValidate,EmailValidateContent,HandselCoupons,HandselCouponsNumber,HandselCouponsBeginTime,HandselCouponsEndTime,HandselPoint,ForbidUserId,AnswerValidate,QuestionFirst,AnswerFirst,QuestionSecond,AnswerSecond,UserDefaultGroup,GetPasswordMethod,LoginPoint,LoginIsNeedCheckCode,AllowOtherLogin,MoneyToCoupons,MoneyToDate,PointToCoupons,PointToDate,CouponsName,CouponsUnits,RegisterRequired,RegisterRequiredOptional from yxs_CustomerSetting "); Model.CustomerSetting model = new Model.CustomerSetting(); DataSet ds = ExecuteDataSet(strSql.ToString()); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["SID"].ToString() != "") { model.SID = int.Parse(ds.Tables[0].Rows[0]["SID"].ToString()); } model.AllowRegister = ds.Tables[0].Rows[0]["AllowRegister"].ToString(); if (ds.Tables[0].Rows[0]["SameEmailRegister"].ToString() != "") { model.SameEmailRegister = int.Parse(ds.Tables[0].Rows[0]["SameEmailRegister"].ToString()); } if (ds.Tables[0].Rows[0]["AdminValidate"].ToString() != "") { model.AdminValidate = int.Parse(ds.Tables[0].Rows[0]["AdminValidate"].ToString()); } if (ds.Tables[0].Rows[0]["EmailValidate"].ToString() != "") { model.EmailValidate = int.Parse(ds.Tables[0].Rows[0]["EmailValidate"].ToString()); } model.EmailValidateContent = ds.Tables[0].Rows[0]["EmailValidateContent"].ToString(); if (ds.Tables[0].Rows[0]["HandselCoupons"].ToString() != "") { model.HandselCoupons = int.Parse(ds.Tables[0].Rows[0]["HandselCoupons"].ToString()); } if (ds.Tables[0].Rows[0]["HandselCouponsNumber"].ToString() != "") { model.HandselCouponsNumber = int.Parse(ds.Tables[0].Rows[0]["HandselCouponsNumber"].ToString()); } if (ds.Tables[0].Rows[0]["HandselCouponsBeginTime"].ToString() != "") { model.HandselCouponsBeginTime = DateTime.Parse(ds.Tables[0].Rows[0]["HandselCouponsBeginTime"].ToString()); } if (ds.Tables[0].Rows[0]["HandselCouponsEndTime"].ToString() != "") { model.HandselCouponsEndTime = DateTime.Parse(ds.Tables[0].Rows[0]["HandselCouponsEndTime"].ToString()); } model.HandselPoint = ds.Tables[0].Rows[0]["HandselPoint"].ToString(); model.ForbidUserId = ds.Tables[0].Rows[0]["ForbidUserId"].ToString(); if (ds.Tables[0].Rows[0]["AnswerValidate"].ToString() != "") { model.AnswerValidate = int.Parse(ds.Tables[0].Rows[0]["AnswerValidate"].ToString()); } model.QuestionFirst = ds.Tables[0].Rows[0]["QuestionFirst"].ToString(); model.AnswerFirst = ds.Tables[0].Rows[0]["AnswerFirst"].ToString(); model.QuestionSecond = ds.Tables[0].Rows[0]["QuestionSecond"].ToString(); model.AnswerSecond = ds.Tables[0].Rows[0]["AnswerSecond"].ToString(); model.UserDefaultGroup = ds.Tables[0].Rows[0]["UserDefaultGroup"].ToString(); if (ds.Tables[0].Rows[0]["GetPasswordMethod"].ToString() != "") { model.GetPasswordMethod = int.Parse(ds.Tables[0].Rows[0]["GetPasswordMethod"].ToString()); } if (ds.Tables[0].Rows[0]["LoginPoint"].ToString() != "") { model.LoginPoint = decimal.Parse(ds.Tables[0].Rows[0]["LoginPoint"].ToString()); } if (ds.Tables[0].Rows[0]["LoginIsNeedCheckCode"].ToString() != "") { model.LoginIsNeedCheckCode = int.Parse(ds.Tables[0].Rows[0]["LoginIsNeedCheckCode"].ToString()); } if (ds.Tables[0].Rows[0]["AllowOtherLogin"].ToString() != "") { model.AllowOtherLogin = int.Parse(ds.Tables[0].Rows[0]["AllowOtherLogin"].ToString()); } model.MoneyToCoupons = ds.Tables[0].Rows[0]["MoneyToCoupons"].ToString(); model.MoneyToDate = ds.Tables[0].Rows[0]["MoneyToDate"].ToString(); model.PointToCoupons = ds.Tables[0].Rows[0]["PointToCoupons"].ToString(); model.PointToDate = ds.Tables[0].Rows[0]["PointToDate"].ToString(); model.CouponsName = ds.Tables[0].Rows[0]["CouponsName"].ToString(); model.CouponsUnits = ds.Tables[0].Rows[0]["CouponsUnits"].ToString(); model.RegisterRequired = ds.Tables[0].Rows[0]["RegisterRequired"].ToString(); model.RegisterRequiredOptional = ds.Tables[0].Rows[0]["RegisterRequiredOptional"].ToString(); return(model); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Model.CustomerSetting model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update yxs_CustomerSetting set "); strSql.Append("AllowRegister=@AllowRegister,"); strSql.Append("SameEmailRegister=@SameEmailRegister,"); strSql.Append("AdminValidate=@AdminValidate,"); strSql.Append("EmailValidate=@EmailValidate,"); strSql.Append("EmailValidateContent=@EmailValidateContent,"); strSql.Append("HandselCoupons=@HandselCoupons,"); strSql.Append("HandselCouponsNumber=@HandselCouponsNumber,"); strSql.Append("HandselCouponsBeginTime=@HandselCouponsBeginTime,"); strSql.Append("HandselCouponsEndTime=@HandselCouponsEndTime,"); strSql.Append("HandselPoint=@HandselPoint,"); strSql.Append("ForbidUserId=@ForbidUserId,"); strSql.Append("AnswerValidate=@AnswerValidate,"); strSql.Append("QuestionFirst=@QuestionFirst,"); strSql.Append("AnswerFirst=@AnswerFirst,"); strSql.Append("QuestionSecond=@QuestionSecond,"); strSql.Append("AnswerSecond=@AnswerSecond,"); strSql.Append("UserDefaultGroup=@UserDefaultGroup,"); strSql.Append("GetPasswordMethod=@GetPasswordMethod,"); strSql.Append("LoginPoint=@LoginPoint,"); strSql.Append("LoginIsNeedCheckCode=@LoginIsNeedCheckCode,"); strSql.Append("AllowOtherLogin=@AllowOtherLogin,"); strSql.Append("MoneyToCoupons=@MoneyToCoupons,"); strSql.Append("MoneyToDate=@MoneyToDate,"); strSql.Append("PointToCoupons=@PointToCoupons,"); strSql.Append("PointToDate=@PointToDate,"); strSql.Append("CouponsName=@CouponsName,"); strSql.Append("CouponsUnits=@CouponsUnits,"); strSql.Append("RegisterRequired=@RegisterRequired,"); strSql.Append("RegisterRequiredOptional=@RegisterRequiredOptional"); strSql.Append(" where SID=@SID "); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "SID", DbType.Int32, model.SID); db.AddInParameter(dbCommand, "AllowRegister", DbType.AnsiString, model.AllowRegister); db.AddInParameter(dbCommand, "SameEmailRegister", DbType.Int32, model.SameEmailRegister); db.AddInParameter(dbCommand, "AdminValidate", DbType.Int32, model.AdminValidate); db.AddInParameter(dbCommand, "EmailValidate", DbType.Int32, model.EmailValidate); db.AddInParameter(dbCommand, "EmailValidateContent", DbType.AnsiString, model.EmailValidateContent); db.AddInParameter(dbCommand, "HandselCoupons", DbType.Int32, model.HandselCoupons); db.AddInParameter(dbCommand, "HandselCouponsNumber", DbType.Int32, model.HandselCouponsNumber); db.AddInParameter(dbCommand, "HandselCouponsBeginTime", DbType.DateTime, model.HandselCouponsBeginTime); db.AddInParameter(dbCommand, "HandselCouponsEndTime", DbType.DateTime, model.HandselCouponsEndTime); db.AddInParameter(dbCommand, "HandselPoint", DbType.AnsiString, model.HandselPoint); db.AddInParameter(dbCommand, "ForbidUserId", DbType.AnsiString, model.ForbidUserId); db.AddInParameter(dbCommand, "AnswerValidate", DbType.Int32, model.AnswerValidate); db.AddInParameter(dbCommand, "QuestionFirst", DbType.AnsiString, model.QuestionFirst); db.AddInParameter(dbCommand, "AnswerFirst", DbType.AnsiString, model.AnswerFirst); db.AddInParameter(dbCommand, "QuestionSecond", DbType.AnsiString, model.QuestionSecond); db.AddInParameter(dbCommand, "AnswerSecond", DbType.AnsiString, model.AnswerSecond); db.AddInParameter(dbCommand, "UserDefaultGroup", DbType.AnsiString, model.UserDefaultGroup); db.AddInParameter(dbCommand, "GetPasswordMethod", DbType.Int32, model.GetPasswordMethod); db.AddInParameter(dbCommand, "LoginPoint", DbType.Decimal, model.LoginPoint); db.AddInParameter(dbCommand, "LoginIsNeedCheckCode", DbType.Int32, model.LoginIsNeedCheckCode); db.AddInParameter(dbCommand, "AllowOtherLogin", DbType.Int32, model.AllowOtherLogin); db.AddInParameter(dbCommand, "MoneyToCoupons", DbType.AnsiString, model.MoneyToCoupons); db.AddInParameter(dbCommand, "MoneyToDate", DbType.AnsiString, model.MoneyToDate); db.AddInParameter(dbCommand, "PointToCoupons", DbType.AnsiString, model.PointToCoupons); db.AddInParameter(dbCommand, "PointToDate", DbType.AnsiString, model.PointToDate); db.AddInParameter(dbCommand, "CouponsName", DbType.AnsiString, model.CouponsName); db.AddInParameter(dbCommand, "CouponsUnits", DbType.AnsiString, model.CouponsUnits); db.AddInParameter(dbCommand, "RegisterRequired", DbType.AnsiString, model.RegisterRequired); db.AddInParameter(dbCommand, "RegisterRequiredOptional", DbType.AnsiString, model.RegisterRequiredOptional); return(0 < db.ExecuteNonQuery(dbCommand)); }