Exemplo n.º 1
0
        /// <summary>
        /// 设置子系统配置信息(webmaster)
        /// </summary>
        /// <param name="setting">配置信息业务实体</param>
        /// <returns></returns>
        public bool SetSysSetting(EyouSoft.Model.ComStructure.MComSetting setting)
        {
            if (setting == null)
            {
                return(false);
            }
            if (string.IsNullOrEmpty(setting.CompanyId))
            {
                return(false);
            }

            if (dal.SetSysSetting(setting))
            {
                string cacheKey = string.Format(EyouSoft.Cache.Tag.TagName.ComSetting, setting.CompanyId);
                EyouSoft.Cache.Facade.EyouSoftCache.Remove(cacheKey);

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 设置子系统配置信息(webmaster)
        /// </summary>
        /// <param name="setting">配置信息业务实体</param>
        /// <returns></returns>
        public bool SetSysSetting(EyouSoft.Model.ComStructure.MComSetting setting)
        {
            #region create xml
            var xml = new StringBuilder();
            xml.Append("<item>");

            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.团号配置, Utils.ReplaceXmlSpecialCharacter(setting.TourNoSetting));
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.列表显示控制_前几个月, setting.ShowBeforeMonth);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.列表显示控制_后几个月, setting.ShowAfterMonth);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.留位时间控制, setting.SaveTime);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.计划停收国内线, setting.CountryArea);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.计划停收省内线, setting.ProvinceArea);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.计划停收出境线, setting.ExitArea);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.积分比例, setting.IntegralProportion);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.跳过导游报账, setting.SkipGuide ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.跳过销售报账, setting.SkipSale ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.跳过报账终审, setting.SkipFinalJudgment ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.劳动合同到期提醒, setting.ContractRemind);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.供应商合同到期提醒, setting.SContractRemind);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.公司合同到期提醒, setting.ComPanyContractRemind);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.财务支出审核, setting.FinancialExpensesReview ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.财务收入审核, setting.FinancialIncomeReview ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.款额度控制, setting.ArrearsRangeControl ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.洒店预控到期提醒, setting.HotelControlRemind);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.车辆预控到期提醒, setting.CarControlRemind);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.游船预控到期提醒, setting.ShipControlRemind);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.是否开启KIS整合, setting.IsEnableKis ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.景点预控到期提醒, setting.SightControlRemind);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)SysConfiguration.其他预控到期提醒, setting.OtherControlRemind);

            //打印单据配置
            if (setting.PrintDocument != null && setting.PrintDocument.Count > 0)
            {
                foreach (var t in setting.PrintDocument)
                {
                    if (t == null)
                    {
                        continue;
                    }

                    xml.AppendFormat("<val id='{0}_{1}'>{2}</val>", (int)SysConfiguration.单据配置, (int)t.PrintTemplateType, t.PrintTemplate);
                }
            }

            xml.AppendFormat("<val id='{0}'>{1}</val>", "MaxUserNumber", setting.MaxUserNumber);
            xml.AppendFormat("<val id='{0}'>{1}</val>", "UserLoginLimitType", (int)setting.UserLoginLimitType);
            xml.AppendFormat("<val id='{0}'>{1}</val>", "IsEnableDuanXian", setting.IsEnableDuanXian ? "1" : "0");
            xml.AppendFormat("<val id='{0}'>{1}</val>", "ZiDongShanChuSanPinJiHua", setting.IsZiDongShanChuSanPinJiHua ? "1" : "0");

            xml.AppendFormat("<val id='{0}'>{1}</val>", "ShouKuanZhiFuFangShi", setting.ShouKuanZhiFuFangShi);
            xml.AppendFormat("<val id='{0}'>{1}</val>", "FuKuanZhiFuFangShi", setting.FuKuanZhiFuFangShi);

            xml.Append("</item>");

            #endregion

            DbCommand cmd = this._db.GetStoredProcCommand(SQL_PROC_SetSettings);
            _db.AddInParameter(cmd, "@CompanyId", DbType.AnsiStringFixedLength, setting.CompanyId);
            _db.AddInParameter(cmd, "@xml", DbType.Xml, xml.ToString());
            _db.AddOutParameter(cmd, "@RetCode", DbType.Int32, 4);

            int sqlExceptionCode = 0;
            try
            {
                DbHelper.RunProcedure(cmd, _db);
            }
            catch (System.Data.SqlClient.SqlException e)
            {
                sqlExceptionCode = 0 - e.Number;
            }

            if (sqlExceptionCode < 0)
            {
                return(false);
            }
            else
            {
                return(Convert.ToInt32(_db.GetParameterValue(cmd, "RetCode")) == 1);
            }
        }