Example #1
0
 /// <summary>
 /// 写入站点配置文件
 /// </summary>
 public Model.Angel_Siteconfig saveConifg(Model.Angel_Siteconfig model, string configFilePath)
 {
     lock (lockcommand)
     {
         AngelSerialization.Save(model, configFilePath);
     }
     return(model);
 }
Example #2
0
 /// <summary>
 ///  读取配置文件
 /// </summary>
 public Model.Angel_Siteconfig loadConfig()
 {
     Model.Angel_Siteconfig model = AngelCacheHelper.Get <Model.Angel_Siteconfig>(AngelConst.ANGEL_CACHE_SITECONFIG);
     if (model == null)
     {
         AngelCacheHelper.Insert(AngelConst.ANGEL_CACHE_SITECONFIG, loadConfig(AngelUtils.GetXmlMapPath(AngelConst.ANGELXML_FILE_SITECONFING)),
                                 AngelUtils.GetXmlMapPath(AngelConst.ANGELXML_FILE_SITECONFING));
         model = AngelCacheHelper.Get <Model.Angel_Siteconfig>(AngelConst.ANGEL_CACHE_SITECONFIG);
     }
     return(model);
 }
Example #3
0
 public AdminPage()
 {
     this.Load      += new EventHandler(AdminPage_Load);
     AngelSiteconfig = new Business.Angel_Siteconfig().loadConfig();
 }
Example #4
0
        public void ProcessRequest(HttpContext context)
        {
            Business.Angel_System_Parameter PBLL = new Business.Angel_System_Parameter();
            string ActionName = context.Request.Params["action"];

            //根据相应操作进行处理
            switch (ActionName)
            {
            case "fromJson":
                AngelRM.Model.Angel_Siteconfig WebSiteInfo = new Business.Angel_Siteconfig().loadConfig();
                string fjson = Angel_DataJson.Object2Json <AngelRM.Model.Angel_Siteconfig>(WebSiteInfo);
                context.Response.Write(fjson);
                break;

            case "Savewebsiteinfo":
                AngelRM.Model.Angel_Siteconfig SiteInfo = new Model.Angel_Siteconfig();
                SiteInfo.Websitename        = context.Request.Params["Websitename"];
                SiteInfo.Websiteurl         = context.Request.Params["Websiteurl"];
                SiteInfo.Websitelogo        = context.Request.Params["Websitelogo"];
                SiteInfo.Websitecompany     = context.Request.Params["Websitecompany"];
                SiteInfo.Websiteaddress     = context.Request.Params["Websiteaddress"];
                SiteInfo.Websitetel         = context.Request.Params["Websitetel"];
                SiteInfo.Websitefax         = context.Request.Params["Websitefax"];
                SiteInfo.Websitemail        = context.Request.Params["Websitemail"];
                SiteInfo.Websitetitle       = context.Request.Params["Websitetitle"];
                SiteInfo.Websitedescription = context.Request.Params["Websitedescription"];
                SiteInfo.Websitecopyright   = context.Request.Params["Websitecopyright"];
                SiteInfo.Websitepath        = context.Request.Params["Websitepath"];
                SiteInfo.Websiteadminpath   = context.Request.Params["Websiteadminpath"];
                SiteInfo.Islogstatus        = Convert.ToInt32(context.Request.Params["Islogstatus"]);
                SiteInfo.Websitestatus      = Convert.ToInt32(context.Request.Params["Websitestatus"]);
                SiteInfo.Websiteclosereason = context.Request.Params["Websiteclosereason"];
                AngelRM.Business.Angel_Siteconfig bll = new Business.Angel_Siteconfig();
                bll.saveConifg(SiteInfo);
                context.Response.Write("{\"success\":true}");
                break;

            case "AddSysparameter":
                AngelRM.Model.Angel_System_Parameter parameter = new Model.Angel_System_Parameter();
                parameter.ParaID   = context.Request.Params["ParaID"];
                parameter.ParaName = context.Request.Params["ParaName"];
                parameter.Data     = context.Request.Params["hidData"];
                if (parameter.ParaID == "" || parameter.ParaID == null || parameter.ParaName == "" || parameter.ParaName == null || parameter.Data == "" || parameter.Data == null)
                {
                    context.Response.Write("{\"success\":false}");
                }
                bool isParaID = PBLL.IsParaIDDataExist(parameter.ParaID);
                if (!isParaID)
                {
                    bool iscount = PBLL.Add(parameter);
                    if (iscount)
                    {
                        context.Response.Write("{\"success\":true}");
                    }
                    else
                    {
                        context.Response.Write("{\"success\":false}");
                    }
                }
                else
                {
                    context.Response.Write("{\"success\":false}");
                }
                break;

            case "UpSysparameter":
                AngelRM.Model.Angel_System_Parameter parameteru = new Model.Angel_System_Parameter();
                parameteru.id       = Convert.ToInt32(context.Request.Params["id"]);
                parameteru.ParaID   = context.Request.Params["ParaID"];
                parameteru.ParaName = context.Request.Params["ParaName"];
                parameteru.Data     = context.Request.Params["hidData"];
                parameteru.IsView   = "1";
                if (parameteru.id < 1 || parameteru.ParaID == null || parameteru.ParaName == "" || parameteru.ParaName == null || parameteru.Data == "" || parameteru.Data == null)
                {
                    context.Response.Write("{\"success\":false}");
                }
                bool isupdate = PBLL.Update(parameteru);
                if (isupdate)
                {
                    context.Response.Write("{\"success\":true}");
                }
                else
                {
                    context.Response.Write("{\"success\":false}");
                }
                break;

            case "DelDB":
                string idd = context.Request.Params["id"];
                if (idd != "")
                {
                    bool isdelete = PBLL.Delete(idd);
                    if (isdelete)
                    {
                        context.Response.Write("{\"success\":true}");
                    }
                    else
                    {
                        context.Response.Write("{\"success\":false}");
                    }
                }
                else
                {
                    context.Response.Write("{\"success\":false}");
                }
                break;

            default:
                context.Response.Write("{\"success\":false}");
                break;
            }
        }