Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e) {
     this.Title = "专题管理";
     if (!IsPostBack) {
         QJVRMS.Business.FeatureFactory featureFactory = new QJVRMS.Business.FeatureFactory();
         logName = CurrentUser.UserLoginName;
         this.Content.InnerHtml = featureFactory.GetFeaturesContent(logName, 10, 1);
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Title = "专题管理";
     if (!IsPostBack)
     {
         QJVRMS.Business.FeatureFactory featureFactory = new QJVRMS.Business.FeatureFactory();
         logName = CurrentUser.UserLoginName;
         this.Content.InnerHtml = featureFactory.GetFeaturesContent(logName, 10, 1);
     }
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e) {
            string result = string.Empty;
            
            string type = get_LinkParam("type");
            string name = string.Empty;
            string featureId = string.Empty;
            
            QJVRMS.Business.FeatureFactory featureFactory = new QJVRMS.Business.FeatureFactory();
            
            switch (type) {
                case "Single"://获取一个专题信息
                    featureId = get_LinkParam("featureId");
                    name = get_LinkParam("name");
                    result = featureFactory.GetFeatureContent(featureId, name);
                    break;
                case "Page"://分页
                    name = get_LinkParam("name");
                    int pageSize = int.Parse(get_LinkParam("size"));
                    int pageIndex = int.Parse(get_LinkParam("index"));
                    result = featureFactory.GetFeaturesContent(name, pageSize, pageIndex);
                    break;
                case "Show":
                    name = get_LinkParam("name");
                    int sSize = int.Parse(get_LinkParam("size"));
                    int sIndex = int.Parse(get_LinkParam("index"));
                    result = featureFactory.ShowFeaturesContent(name, sSize, sIndex);
                    break;
                case "Update":
                    name = get_LinkParam("name");
                    featureId = get_LinkParam("featureId");
                    string featureName = get_LinkParam("featureName");
                    string featureDes = get_LinkParam("des");
                    string coverImage = get_LinkParam("cover");
                    bool bUpdate = get_LinkParam("state") == "0" ? false : true;
                    if(featureFactory.EditFeature(featureId, featureName, featureDes, name, bUpdate, coverImage, type))
                        result = "更新成功";
                    else
                        result = "更新失败";
                    break;
                case "Add":
                    name = get_LinkParam("name");
                    featureId = Guid.NewGuid().ToString();
                    string fName = get_LinkParam("featureName");
                    string fDes = get_LinkParam("des");
                    string cImage = get_LinkParam("cover");
                    bool bAdd = get_LinkParam("state") == "0" ? false : true;
                    if (featureFactory.EditFeature(featureId, fName, fDes, name, bAdd, cImage, type))
                        result = "增加成功;" + featureId;
                    else
                        result = "增加失败";
                    break;
                case "Image":
                    featureId = get_LinkParam("featureId");
                    int size = int.Parse(get_LinkParam("size"));
                    int index = int.Parse(get_LinkParam("index"));
                    result = featureFactory.GetFeatureImagesContent(featureId, 0, size, index);
                    break;
                case "Detail":
                    featureId = get_LinkParam("featureId");
                    int dSize = int.Parse(get_LinkParam("size"));
                    int dIndex = int.Parse(get_LinkParam("index"));
                    result = featureFactory.ShowFeatureImagesContent(featureId, 0, dSize, dIndex);
                    break;
                case "Search":
                    string keyword = get_LinkParam("search");
                    int ssize = int.Parse(get_LinkParam("size"));
                    int sindex = int.Parse(get_LinkParam("index"));
                    string id = get_LinkParam("id");
                    featureId = get_LinkParam("featureId");
                    string sparam = get_LinkParam("param");
                    string st = get_LinkParam("t");
                    result = featureFactory.SearchImagesContent(keyword, id, featureId, ssize, sindex, sparam, st);
                    break;
                case "Save":
                    featureId = get_LinkParam("featureId");
                    string param = get_LinkParam("param");
                    string t = get_LinkParam("t");
                    if (t == "order") {
                        string[] ss = param.Split(';');
                        QJVRMS.Business.Orders orders = new QJVRMS.Business.Orders();
                        orders.AddResourceToOrders(featureId, ss);
                    }
                    else {
                        foreach (string imageId in param.Split(';')) {
                            if (!string.IsNullOrEmpty(imageId))
                                featureFactory.AddFeatureDetail(featureId, imageId);
                        }
                    }
                    result = "成功";
                    break;
                case "Top":
                    result = featureFactory.GetTopCatalogContent();
                    break;
                case "Child":
                    string parentId = get_LinkParam("parentId");
                    result = featureFactory.GetChildCatalogContent(parentId);
                    break;
                case "Catalog":
                    string catalogId = get_LinkParam("catalogId");
                    int csize = int.Parse(get_LinkParam("size"));
                    int cindex = int.Parse(get_LinkParam("index"));
                    string cid = get_LinkParam("id");
                    featureId = get_LinkParam("featureId");
                    string cparam = get_LinkParam("param");
                    string ct = get_LinkParam("t");
                    result = featureFactory.CatalogImagesContent(catalogId, cid, featureId, csize, cindex, cparam, ct);
                    break;
                case "Delete":
                    string fid = get_LinkParam("id");
                    if (featureFactory.DeleteFeatureDetail(fid))
                        result = fid;
                    break;
                case "NewWater":
                    string showType = get_LinkParam("show");
                    try {
                        string temppath = Server.MapPath(TEMPPATH);
                        string newshow = string.Empty;
                        if (File.Exists(temppath)) {
                            if (UpdateWaterImage(temppath, ref newshow))
                                File.Delete(temppath);
                        }
                        string xmlPath = Server.MapPath(XMLPATH);
                        if (File.Exists(xmlPath))
                            GetXml(showType, xmlPath);
                        result = "保存设置成功|" + newshow;
                    }
                    catch {
                        result = string.Empty;
                    }
                    break;
                case "default":
                    string dType = get_LinkParam("show");
                    try {
                        string dpath = Server.MapPath(DEFAULTPATH);
                        string dshow = string.Empty;
                        if (File.Exists(dpath)) {
                            UpdateWaterImage(dpath, ref dshow);
                        }
                        string xPath = Server.MapPath(XMLPATH);
                        if (File.Exists(xPath))
                            GetXml(dType, xPath);
                        result = "保存默认设置成功|" + dshow;
                    }
                    catch {
                        result = string.Empty;
                    }
                    break;
                case "OldWater":
                    string sType = get_LinkParam("show");
                    try {
                        //string savepath = Server.MapPath(SAVEPATH);
                        string oldshow = string.Empty;
                        //if (File.Exists(savepath)) {
                        //    UpdateWaterImage(savepath, ref oldshow);
                        //}
                        string xPath = Server.MapPath(XMLPATH);
                        if (File.Exists(xPath))
                            GetXml(sType, xPath);
                        result = "保存设置成功";
                    }
                    catch {
                        result = string.Empty;
                    }
                    break;
                case "Cover":
                    featureId = get_LinkParam("featureId");
                    name = get_LinkParam("name");
                    string src = get_LinkParam("src");
                    string folderName = get_LinkParam("foldername");
                    if (featureFactory.UpdateCoverImage(featureId, name, folderName)) {
                        result = src + ";" + name;
                    }
                    break;
                case "System":
                    string msmtp = get_LinkParam("s");
                    string mname = get_LinkParam("n");
                    string mpass = get_LinkParam("p");
                    string mport = get_LinkParam("t");
                    string mfrom = get_LinkParam("from");
                    string mto = get_LinkParam("to");
                    name = get_LinkParam("u");
                    if (SaveXml(Server.MapPath(SYSTEMPATH), msmtp, mname, mpass, mport, mfrom, mto, name)) {
                        result = "保存设置成功";
                    }
                    else {
                        result = "保存设置成功";
                    }
                    break;
                case "history":
                    string c = get_LinkParam("c");
                    string f = get_LinkParam("t");
                    if(string.IsNullOrEmpty(c)){
                        result = BuildString(Server.MapPath(SYSTEMPATH));
                    }
                    else {
                        XmlDocument doc = new XmlDocument();
                        doc.Load(Server.MapPath(SYSTEMPATH));
                        XmlNodeList list = doc.SelectNodes("Root/LogItem");
                        if (list.Count != 0) {
                            if (f == "next") {
                                if (c != list.Count.ToString()) {
                                    c = (int.Parse(c) + 1).ToString();
                                }
                                else {
                                    c = "1";
                                }
                            }
                            else if (f == "pre") {
                                if (c == "1") {
                                    c = list.Count.ToString(); ;
                                }
                                else {
                                    c = (int.Parse(c) - 1).ToString();
                                }
                            }
                            result = BuildString(doc, c);
                        }
                    }
                    if (string.IsNullOrEmpty(result))
                        result = "<span style='color:red;'>没有历史记录</span>";
                    break;
            }

            Response.Write(result);
            Response.End();
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string result = string.Empty;

            string type      = get_LinkParam("type");
            string name      = string.Empty;
            string featureId = string.Empty;

            QJVRMS.Business.FeatureFactory featureFactory = new QJVRMS.Business.FeatureFactory();

            switch (type)
            {
            case "Single":    //获取一个专题信息
                featureId = get_LinkParam("featureId");
                name      = get_LinkParam("name");
                result    = featureFactory.GetFeatureContent(featureId, name);
                break;

            case "Page":    //分页
                name = get_LinkParam("name");
                int pageSize  = int.Parse(get_LinkParam("size"));
                int pageIndex = int.Parse(get_LinkParam("index"));
                result = featureFactory.GetFeaturesContent(name, pageSize, pageIndex);
                break;

            case "Show":
                name = get_LinkParam("name");
                int sSize  = int.Parse(get_LinkParam("size"));
                int sIndex = int.Parse(get_LinkParam("index"));
                result = featureFactory.ShowFeaturesContent(name, sSize, sIndex);
                break;

            case "Update":
                name      = get_LinkParam("name");
                featureId = get_LinkParam("featureId");
                string featureName = get_LinkParam("featureName");
                string featureDes  = get_LinkParam("des");
                string coverImage  = get_LinkParam("cover");
                bool   bUpdate     = get_LinkParam("state") == "0" ? false : true;
                if (featureFactory.EditFeature(featureId, featureName, featureDes, name, bUpdate, coverImage, type))
                {
                    result = "更新成功";
                }
                else
                {
                    result = "更新失败";
                }
                break;

            case "Add":
                name      = get_LinkParam("name");
                featureId = Guid.NewGuid().ToString();
                string fName  = get_LinkParam("featureName");
                string fDes   = get_LinkParam("des");
                string cImage = get_LinkParam("cover");
                bool   bAdd   = get_LinkParam("state") == "0" ? false : true;
                if (featureFactory.EditFeature(featureId, fName, fDes, name, bAdd, cImage, type))
                {
                    result = "增加成功;" + featureId;
                }
                else
                {
                    result = "增加失败";
                }
                break;

            case "Image":
                featureId = get_LinkParam("featureId");
                int size  = int.Parse(get_LinkParam("size"));
                int index = int.Parse(get_LinkParam("index"));
                result = featureFactory.GetFeatureImagesContent(featureId, 0, size, index);
                break;

            case "Detail":
                featureId = get_LinkParam("featureId");
                int dSize  = int.Parse(get_LinkParam("size"));
                int dIndex = int.Parse(get_LinkParam("index"));
                result = featureFactory.ShowFeatureImagesContent(featureId, 0, dSize, dIndex);
                break;

            case "Search":
                string keyword = get_LinkParam("search");
                int    ssize   = int.Parse(get_LinkParam("size"));
                int    sindex  = int.Parse(get_LinkParam("index"));
                string id      = get_LinkParam("id");
                featureId = get_LinkParam("featureId");
                string sparam = get_LinkParam("param");
                string st     = get_LinkParam("t");
                result = featureFactory.SearchImagesContent(keyword, id, featureId, ssize, sindex, sparam, st);
                break;

            case "Save":
                featureId = get_LinkParam("featureId");
                string param = get_LinkParam("param");
                string t     = get_LinkParam("t");
                if (t == "order")
                {
                    string[] ss = param.Split(';');
                    QJVRMS.Business.Orders orders = new QJVRMS.Business.Orders();
                    orders.AddResourceToOrders(featureId, ss);
                }
                else
                {
                    foreach (string imageId in param.Split(';'))
                    {
                        if (!string.IsNullOrEmpty(imageId))
                        {
                            featureFactory.AddFeatureDetail(featureId, imageId);
                        }
                    }
                }
                result = "成功";
                break;

            case "Top":
                result = featureFactory.GetTopCatalogContent();
                break;

            case "Child":
                string parentId = get_LinkParam("parentId");
                result = featureFactory.GetChildCatalogContent(parentId);
                break;

            case "Catalog":
                string catalogId = get_LinkParam("catalogId");
                int    csize     = int.Parse(get_LinkParam("size"));
                int    cindex    = int.Parse(get_LinkParam("index"));
                string cid       = get_LinkParam("id");
                featureId = get_LinkParam("featureId");
                string cparam = get_LinkParam("param");
                string ct     = get_LinkParam("t");
                result = featureFactory.CatalogImagesContent(catalogId, cid, featureId, csize, cindex, cparam, ct);
                break;

            case "Delete":
                string fid = get_LinkParam("id");
                if (featureFactory.DeleteFeatureDetail(fid))
                {
                    result = fid;
                }
                break;

            case "NewWater":
                string showType = get_LinkParam("show");
                try {
                    string temppath = Server.MapPath(TEMPPATH);
                    string newshow  = string.Empty;
                    if (File.Exists(temppath))
                    {
                        if (UpdateWaterImage(temppath, ref newshow))
                        {
                            File.Delete(temppath);
                        }
                    }
                    string xmlPath = Server.MapPath(XMLPATH);
                    if (File.Exists(xmlPath))
                    {
                        GetXml(showType, xmlPath);
                    }
                    result = "保存设置成功|" + newshow;
                }
                catch {
                    result = string.Empty;
                }
                break;

            case "default":
                string dType = get_LinkParam("show");
                try {
                    string dpath = Server.MapPath(DEFAULTPATH);
                    string dshow = string.Empty;
                    if (File.Exists(dpath))
                    {
                        UpdateWaterImage(dpath, ref dshow);
                    }
                    string xPath = Server.MapPath(XMLPATH);
                    if (File.Exists(xPath))
                    {
                        GetXml(dType, xPath);
                    }
                    result = "保存默认设置成功|" + dshow;
                }
                catch {
                    result = string.Empty;
                }
                break;

            case "OldWater":
                string sType = get_LinkParam("show");
                try {
                    //string savepath = Server.MapPath(SAVEPATH);
                    string oldshow = string.Empty;
                    //if (File.Exists(savepath)) {
                    //    UpdateWaterImage(savepath, ref oldshow);
                    //}
                    string xPath = Server.MapPath(XMLPATH);
                    if (File.Exists(xPath))
                    {
                        GetXml(sType, xPath);
                    }
                    result = "保存设置成功";
                }
                catch {
                    result = string.Empty;
                }
                break;

            case "Cover":
                featureId = get_LinkParam("featureId");
                name      = get_LinkParam("name");
                string src        = get_LinkParam("src");
                string folderName = get_LinkParam("foldername");
                if (featureFactory.UpdateCoverImage(featureId, name, folderName))
                {
                    result = src + ";" + name;
                }
                break;

            case "System":
                string msmtp = get_LinkParam("s");
                string mname = get_LinkParam("n");
                string mpass = get_LinkParam("p");
                string mport = get_LinkParam("t");
                string mfrom = get_LinkParam("from");
                string mto   = get_LinkParam("to");
                name = get_LinkParam("u");
                if (SaveXml(Server.MapPath(SYSTEMPATH), msmtp, mname, mpass, mport, mfrom, mto, name))
                {
                    result = "保存设置成功";
                }
                else
                {
                    result = "保存设置成功";
                }
                break;

            case "history":
                string c = get_LinkParam("c");
                string f = get_LinkParam("t");
                if (string.IsNullOrEmpty(c))
                {
                    result = BuildString(Server.MapPath(SYSTEMPATH));
                }
                else
                {
                    XmlDocument doc = new XmlDocument();
                    doc.Load(Server.MapPath(SYSTEMPATH));
                    XmlNodeList list = doc.SelectNodes("Root/LogItem");
                    if (list.Count != 0)
                    {
                        if (f == "next")
                        {
                            if (c != list.Count.ToString())
                            {
                                c = (int.Parse(c) + 1).ToString();
                            }
                            else
                            {
                                c = "1";
                            }
                        }
                        else if (f == "pre")
                        {
                            if (c == "1")
                            {
                                c = list.Count.ToString();;
                            }
                            else
                            {
                                c = (int.Parse(c) - 1).ToString();
                            }
                        }
                        result = BuildString(doc, c);
                    }
                }
                if (string.IsNullOrEmpty(result))
                {
                    result = "<span style='color:red;'>没有历史记录</span>";
                }
                break;
            }

            Response.Write(result);
            Response.End();
        }