Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                string work = objectHandlers.Post("work");
                switch (work)
                {
                    case "AddNew":

                        break;
                }
            }
            else
            {

                FileStream fs = new FileStream(HttpContext.Current.Server.MapPath("/database/taobao1.csv"), FileMode.Open, FileAccess.Read);
                StreamReader sr = new StreamReader(fs);
                string t = sr.ReadToEnd();

                string text = "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"#006600\" width=\"4770\" >";
                string[] arr = t.Split(new string[] { "\n" }, StringSplitOptions.None);

                Dictionary<string, EntityBase> ps = base.handlerService.skinService.propertiesHandlers.GetPropertiesByCIdEntity("1");
                for (int i = 0; i < arr.Length; i++)
                {

                    string[] arr1 = arr[i].Split(new string[] { "\t" }, StringSplitOptions.None);

                    if (arr1.Length>=45)
                    {
                        if (i < 15)
                        {
                            text += "<tr>";

                            string ext = "bgcolor=\"#FFFFFF\"";
                            if (i == 0)
                            {
                                ext = "bgcolor=\"#009900\"";
                                for (int n = 0; n < arr1.Length; n++)
                                {
                                    string text2 = "(" + n.ToString() + ")" + arr1[n];
                                    text += "<td width=\"100\"  height=\"25\" " + ext + ">" + text2 + "</td>";

                                }
                            }
                            else
                            {
                                for (int n = 0; n < arr1.Length; n++)
                                {
                                    string text2 = (n == 24) ? "" : arr1[n];
                                    text += "<td width=\"100\"  height=\"25\" " + ext + ">" + text2 + "</td>";

                                }
                            }

                            text += "</tr>";

                        }

                        int curPage = 0;
                        int pageCount = 0;
                        int count = 0;

                        Dictionary<string, EntityBase> ress = null;
                        try
                        {
                            ress = base.handlerService.resourcsService.resourcesHandlers.GetResourcesListPager(ref curPage, ref pageCount, ref count,
                                   0, 15, "dAddDate DESC,ID DESC", "SheifUrl='" + arr1[44] + "'");
                        }
                        catch (Exception ex)
                        {

                        }

                        Resources res = new Resources();

                        if (ress != null && ress.Count == 1)
                        {
                            foreach (KeyValuePair<string, EntityBase> entity1 in ress)
                            {
                                res = (Resources)entity1.Value;

                            }

                            res.vcTitle = objectHandlers.GetTextWithoutHtml(arr1[0]).Replace("<","").Replace(">","");
                            res.vcKeyWord = objectHandlers.GetTextWithoutHtml(arr1[0]).Replace("<", "").Replace(">", ""); ;
                            res.vcContent = arr1[24].Replace("\"\"", "'");
                            res.SheifUrl = arr1[43];
                            res.vcSmallImg = "/filePatch/taobao/" + arr1[35].Split(';')[0].Split('|')[0].Split(':')[0].Replace("\"", "") + ".jpg";

                            int rtn = -1;
                            rtn = base.handlerService.resourcsService.resourcesHandlers.UpdateResources(res);

                            string txt = "";

                            Dictionary<string, EntityBase> aps = base.handlerService.resourcsService.resourcesHandlers.GetResourcePropertiesByRIdEntity(res.Id);

                            foreach (KeyValuePair<string, EntityBase> entity in aps)
                            {
                                ResourceProperties pp = (ResourceProperties)entity.Value;

                                if (pp.PropertieId == 1) //价格
                                {
                                    pp.PropertieValue = objectHandlers.ToFloat(arr1[7]).ToString("0.00");
                                }
                                else if (pp.PropertieId == 2) //所在地
                                {
                                    pp.PropertieValue = arr1[4] + arr1[5];
                                }
                                else if (pp.PropertieId == 3) //QQ交谈
                                {
                                    pp.PropertieValue = "644139466";
                                }
                                else if (pp.PropertieId == 4) //旺旺
                                {
                                    pp.PropertieValue = "%E9%99%B6%E8%A8%80%E8%B9%8A";
                                }
                                else if (pp.PropertieId == 5) //展示图片1
                                {
                                    if (arr1[35].Split(';').Length >= 3)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[1].Split('|')[1].Replace("\"","");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }
                                else if (pp.PropertieId == 6) //展示图片2
                                {
                                    if (arr1[35].Split(';').Length >= 4)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[2].Split('|')[1].Replace("\"", "");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }
                                else if (pp.PropertieId == 7) //展示图片3
                                {
                                    if (arr1[35].Split(';').Length >= 5)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[3].Split('|')[1].Replace("\"", "");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }
                                else if (pp.PropertieId == 8) //展示图片4
                                {
                                    if (arr1[35].Split(';').Length >= 6)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[4].Split('|')[1].Replace("\"", "");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }

                                //<a target="_blank" href="http://www.taobao.com/webww/ww.php?ver=3&touid=sanyungui&siteid=cntaobao&status=1&charset=utf-8"><img border="0" src="http://amos.alicdn.com/online.aw?v=2&uid=sanyungui&site=cntaobao&s=1&charset=utf-8" alt="点击这里给我发消息" /></a>
                                //<a target="_blank" href="http://www.taobao.com/webww/ww.php?ver=3&touid=%E9%99%B6%E8%A8%80%E8%B9%8A&siteid=cntaobao&status=1&charset=utf-8"><img border="0" src="http://amos.alicdn.com/online.aw?v=2&uid=%E9%99%B6%E8%A8%80%E8%B9%8A&site=cntaobao&s=1&charset=utf-8" alt="点击这里给我发消息" /></a>

                                pp.PropertieValue = pp.PropertieValue.Replace("'", "''");

                                rtn = base.handlerService.resourcsService.resourcesHandlers.ResourcePropertiesManage(base.adminInfo, pp);
                                txt = rtn == 1 ? "属性[" + pp.PropertieName + "]修改成功!" : errHandlers.GetErrTextByErrCode(rtn, ConfigServiceEx.baseConfig["ManagePath"]);
                                Response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;·" + txt + "<br/>");

                            }
                        }
                        else
                        {

                            res.Id = (base.handlerService.resourcsService.resourcesHandlers.GetMaxResourceId() + 1).ToString();
                            res.vcAuthor = "-";
                            res.vcTitle = objectHandlers.GetTextWithoutHtml(arr1[0]).Replace("<", "").Replace(">", ""); ;
                            res.vcKeyWord = objectHandlers.GetTextWithoutHtml(arr1[0]).Replace("<", "").Replace(">", ""); ;
                            res.vcContent = arr1[24].Replace("\"\"", "'");
                            res.Categorie = base.handlerService.skinService.categoriesHandlers.GetCategoriesById("cfc0175d-04d9-45ad-a1ac-5762bb304521");
                            res.vcEditor = "-";
                            res.PropertiesCategorieId = 1;
                            res.SheifUrl = arr1[44];

                            res.vcSmallImg = "/filePatch/taobao/" + arr1[35].Split(';')[0].Split('|')[0].Split(':')[0].Replace("\"","") + ".jpg";

                            int rtn = -1;
                            rtn = base.handlerService.resourcsService.resourcesHandlers.CreateResources(res);
                            string txt = "";

                            foreach (KeyValuePair<string, EntityBase> entity in ps)
                            {
                                Properties ppti = (Properties)entity.Value;
                                ResourceProperties pp = new ResourceProperties();
                                pp.Id = "";
                                pp.PropertieId = objectHandlers.ToInt(ppti.Id);
                                pp.PropertieName = ppti.ProertieName;
                                pp.ResourceId = res.Id;

                                if (pp.PropertieId == 1) //价格
                                {
                                    pp.PropertieValue =  objectHandlers.ToFloat( arr1[7]).ToString("0.00");
                                }
                                else if (pp.PropertieId == 2) //所在地
                                {
                                    pp.PropertieValue = arr1[4] + arr1[5];
                                }
                                else if (pp.PropertieId == 3) //QQ交谈
                                {
                                    pp.PropertieValue = "644139466";
                                }
                                else if (pp.PropertieId == 4) //旺旺
                                {
                                    pp.PropertieValue = "%E9%99%B6%E8%A8%80%E8%B9%8A";
                                }
                                else if (pp.PropertieId == 5) //展示图片1
                                {
                                    if (arr1[35].Split(';').Length >= 3)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[1].Split('|')[1].Replace("\"", "");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }
                                else if (pp.PropertieId == 6) //展示图片2
                                {
                                    if (arr1[35].Split(';').Length >= 4)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[2].Split('|')[1].Replace("\"", "");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }
                                else if (pp.PropertieId == 7) //展示图片3
                                {
                                    if (arr1[35].Split(';').Length >= 5)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[3].Split('|')[1].Replace("\"", "");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }
                                else if (pp.PropertieId == 8) //展示图片4
                                {
                                    if (arr1[35].Split(';').Length >= 6)
                                    {
                                        pp.PropertieValue = arr1[35].Split(';')[4].Split('|')[1].Replace("\"", "");
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                }

                                //<a target="_blank" href="http://www.taobao.com/webww/ww.php?ver=3&touid=sanyungui&siteid=cntaobao&status=1&charset=utf-8"><img border="0" src="http://amos.alicdn.com/online.aw?v=2&uid=sanyungui&site=cntaobao&s=1&charset=utf-8" alt="点击这里给我发消息" /></a>
                                //<a target="_blank" href="http://www.taobao.com/webww/ww.php?ver=3&touid=%E9%99%B6%E8%A8%80%E8%B9%8A&siteid=cntaobao&status=1&charset=utf-8"><img border="0" src="http://amos.alicdn.com/online.aw?v=2&uid=%E9%99%B6%E8%A8%80%E8%B9%8A&site=cntaobao&s=1&charset=utf-8" alt="点击这里给我发消息" /></a>

                                pp.PropertieValue = pp.PropertieValue.Replace("'", "''");

                                rtn = base.handlerService.resourcsService.resourcesHandlers.ResourcePropertiesManage(base.adminInfo, pp);
                                txt = rtn == 1 ? "属性[" + pp.PropertieName + "]添加成功!" : errHandlers.GetErrTextByErrCode(rtn, ConfigServiceEx.baseConfig["ManagePath"]);
                                Response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;·" + txt + "<br/>");
                            }

                            txt = rtn == 1 ? "导入成功!" : errHandlers.GetErrTextByErrCode(rtn, ConfigServiceEx.baseConfig["ManagePath"]);
                        }
                    }
                }

                text += "</table>";
                dataveiw.InnerHtml = text;
            }
        }
Beispiel #2
0
        public int ResourcePropertiesManage(Admin admin, ResourceProperties cp)
        {
            int rtn = HandlersFactory.adminHandlers.CheckAdminPower(admin);
            if (rtn < 0) return rtn;

            return DataBaseFactory.ResourceHandlers.ResourcePropertiesManage(cp);
        }
        private void NewsManage(bool ismdy)
        {
            string categorieid = objectHandlers.Post("iClassId");
            Resources item = new Resources();

            int pcid = objectHandlers.ToInt(objectHandlers.Post("scp"));
            bool delrpold = false;
            int oldrpoid = 0;
            if (ismdy)
            {
                item = base.handlerService.resourcsService.resourcesHandlers.GetResourcesById(objectHandlers.ToInt(objectHandlers.Post("iNewsId")));
                if (item.PropertiesCategorieId != pcid)
                {
                    delrpold = true;
                    oldrpoid = item.PropertiesCategorieId;
                }
            }
            else
            {
                item.cChecked = "N";
                item.cCreated = "N";
                item.Id = (base.handlerService.resourcsService.resourcesHandlers.GetMaxResourceId() + 1).ToString();
            }

            item.vcTitle = objectHandlers.Post("iTitle");
            item.vcUrl = objectHandlers.Post("iUrl");
            item.vcContent = objectHandlers.Post("taContent");
            item.vcAuthor = objectHandlers.Post("iAuthor");
            item.vcKeyWord = objectHandlers.Post("iKeyWords");
            item.CCCategories = objectHandlers.Post("ccCheckBox");

            if (item.Categorie.Id != categorieid)
            {
                item.Categorie = base.handlerService.skinService.categoriesHandlers.GetCategoriesById(categorieid);
            }

            item.vcSpeciality = objectHandlers.Post("iSpeciality");
            item.vcBigImg = objectHandlers.Post("iBigImg");
            item.vcSmallImg = objectHandlers.Post("iSmallImg");
            item.vcTitleColor = objectHandlers.Post("sTitleColor");
            item.cStrong = objectHandlers.Post("iStrong");
            string s = objectHandlers.Post("iShortContent");
            item.vcShortContent = string.IsNullOrEmpty(s) ? objectHandlers.Left(objectHandlers.Post("iShortContent"), 100) : s;
            item.PropertiesCategorieId = pcid;

            if (string.IsNullOrEmpty(item.vcTitle))
            {
                base.AjaxErch(-1000000039, "");
                return;
            }

            if (string.IsNullOrEmpty(item.vcKeyWord))
            {
                base.AjaxErch(-1000000043, "");
                return;
            }

            if (string.IsNullOrEmpty(item.Categorie.Id))
            {
                base.AjaxErch(-1000000056, "");
                return;
            }

            item.vcEditor = base.adminInfo.vcAdminName;

            string filepath = "";
            string errText = string.Empty;
            int rtn = 0;

            if (!string.IsNullOrEmpty(item.vcUrl))
            {
                item.cCreated = "Y";
                item.cChecked = "Y";
            }

            try
            {
                if (!ismdy)
                {
                    rtn = base.handlerService.resourcsService.resourcesHandlers.CreateResources(item);
                    //处理
                    if (!string.IsNullOrEmpty(item.CCCategories))
                    {
                        string mid = item.Id;
                        item.CCCategories = item.CCCategories + ",";
                        if (item.CCCategories.IndexOf(",") > -1)
                        {
                            string[] ccs = item.CCCategories.Split(',');
                            for (int i = 0; i < ccs.Length; i++)
                            {
                                string txg = ccs[i];
                                if (!string.IsNullOrEmpty(txg))
                                {
                                    item.Id = (base.handlerService.resourcsService.resourcesHandlers.GetMaxResourceId() + 1).ToString();
                                    item.Categorie = base.handlerService.skinService.categoriesHandlers.GetCategoriesById(txg);
                                    item.SheifUrl = mid;
                                    item.CCCategories = "";
                                    rtn = base.handlerService.resourcsService.resourcesHandlers.CreateResources(item);
                                }
                            }
                        }
                    }
                }
                else
                {
                    rtn = base.handlerService.resourcsService.resourcesHandlers.UpdateResources(item);
                    if (delrpold)
                    {
                        rtn = base.handlerService.resourcsService.resourcesHandlers.DelResourcesProperties(item.Id);
                    }

                    //处理
                    if (!string.IsNullOrEmpty(item.CCCategories))
                    {
                        string mid1 = item.Id;
                        item.CCCategories = item.CCCategories + ",";
                        if (item.CCCategories.IndexOf(",") > -1)
                        {
                            string[] ccs = item.CCCategories.Split(',');
                            for (int i = 0; i < ccs.Length; i++)
                            {
                                string txg1 = ccs[i];
                                if (!string.IsNullOrEmpty(txg1))
                                {
                                    int num3 = 0, num2 = 0, num1 = 0;
                                    Dictionary<string, EntityBase> res = base.handlerService.resourcsService.resourcesHandlers.GetResourcesListPager(ref num3,
                                        ref num2, ref num1, 1, 1, "ID desc", "SheifUrl='" + mid1 + "' AND iClassid = '" + txg1 + "'");
                                    if (res != null && res.Count == 1)
                                    {
                                        Resources res1 = null;
                                        foreach (KeyValuePair<string, EntityBase> entity in res)
                                        {
                                            res1 = (Resources)entity.Value;
                                        }
                                        item.Id = res1.Id;
                                        item.Categorie = res1.Categorie;
                                        item.SheifUrl = res1.SheifUrl;
                                        item.CCCategories = "";
                                        rtn = base.handlerService.resourcsService.resourcesHandlers.UpdateResources(item);
                                    }
                                    else
                                    {
                                        item.Id = (base.handlerService.resourcsService.resourcesHandlers.GetMaxResourceId() + 1).ToString();
                                        item.Categorie = base.handlerService.skinService.categoriesHandlers.GetCategoriesById(txg1);
                                        item.SheifUrl = mid1;
                                        item.CCCategories = "";
                                        rtn = base.handlerService.resourcsService.resourcesHandlers.CreateResources(item);
                                    }
                                }
                            }
                        }
                    }
                }

                if (rtn == 1)
                {

                    foreach (string key in Request.Form.AllKeys)
                    {
                        if (key == string.Empty)
                        {
                            string sdgsg = "";
                        }
                        string[] keys = key.Split('_');

                        if (key.IndexOf("rpvalue_") > -1 && !string.IsNullOrEmpty(objectHandlers.Post(key)))
                        {
                            ResourceProperties rps = new ResourceProperties();
                            rps.Id = objectHandlers.Post("rpid_" + keys[1]);
                            rps.PropertieName = objectHandlers.Post("ptname_" + keys[1]);
                            rps.ResourceId = item.Id;
                            rps.PropertieValue = objectHandlers.Post("rpvalue_" + keys[1]);
                            rps.PropertieId = objectHandlers.ToInt(objectHandlers.Post("cpid_" + keys[1]));
                            rps.iOrder = objectHandlers.ToInt(objectHandlers.Post("rporder_" + keys[1]));
                            rtn = base.handlerService.resourcsService.resourcesHandlers.ResourcePropertiesManage(base.adminInfo, rps);
                        }
                        else if (key.IndexOf("rpvalue_") > -1 && string.IsNullOrEmpty(objectHandlers.Post(key)))
                        {

                            string Id = objectHandlers.Post("rpid_" + keys[1]);
                            if (!string.IsNullOrEmpty(Id))
                            {
                                rtn = base.handlerService.resourcsService.resourcesHandlers.DelResourcesPropertiesOnIds(item.Id, Id);
                            }
                        }
                    }
                }

                if (item.cChecked == "Y")
                {
                    rtn = base.handlerService.tagService.CreateResourcHtmlById(ref errText, objectHandlers.ToInt(item.Id));
                }

                //更新列表分页第一页
                int pagecount = 0;
                if (item.cChecked == "Y" && item.cCreated == "Y" && item.cDel == "N")
                {
                    rtn = base.handlerService.tagService.CreateClassList(item.Categorie.Id, 0, ref pagecount, ref errText);
                }
            }
            catch (Exception ex)
            {
                base.ajaxdata = "{state:false,message:\"" + objectHandlers.JSEncode(ex.Message.ToString()) + "\"}";
                base.AjaxErch(base.ajaxdata);
                return;
            }

            if (ismdy)
            {
                base.AjaxErch(rtn, "文章修改成功!");
            }
            else
            {
                base.AjaxErch(rtn, "文章添加成功,请继续添加!", "NewsAddPostBack()");
            }
        }
Beispiel #4
0
        public int ResourcePropertiesManage(ResourceProperties cp)
        {
            string sql = string.Empty;
            string errText = string.Empty;
            if (string.IsNullOrEmpty(cp.Id))
            {
                sql = "INSERT INTO ResourceProperties(ResourceId,PropertieName,PropertieValue,PropertieId,iOrder) VALUES("
                + "'" + cp.ResourceId + "','" + cp.PropertieName + "','" + cp.PropertieValue + "','" + cp.PropertieId + "'," + cp.iOrder + ")";
            }
            else
            {

                string s_cont = string.Empty;
                int rtn = MsSqlFactory.conn.m_ExecuteScalar(ref errText, "SELECT COUNT(1) FROM ResourceProperties WHERE ResourceId = '"
                    + cp.ResourceId + "' AND PropertieId='" + cp.PropertieId + "'", ref s_cont);

                if (rtn < 0) return rtn;

                int ncount = objectHandlers.ToInt(s_cont);
                if (ncount > 0)
                {
                    sql = "UPDATE ResourceProperties SET ResourceId='" + cp.ResourceId + "',PropertieName='" + cp.PropertieName + "',PropertieValue='" + cp.PropertieValue
                        + "',PropertieId='" + cp.PropertieId + "',iOrder=" + cp.iOrder + " WHERE id=" + cp.Id;
                }
                else
                {
                    sql = "INSERT INTO ResourceProperties(ResourceId,PropertieName,PropertieValue,PropertieId,iOrder) VALUES("
                 + "'" + cp.ResourceId + "','" + cp.PropertieName + "','" + cp.PropertieValue + "','" + cp.PropertieId + "'," + cp.iOrder + ")";
                }
            }

            return MsSqlFactory.conn.m_RunSQL(ref errText, sql);
        }
Beispiel #5
0
 /// <summary>
 /// 从记录行中得到实体
 /// </summary>
 /// <param name="?"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static EntityBase GetEntityObjectFromRow(DataRow row, Type type)
 {
     if (row == null) return null;
     switch (type.ToString())
     {
         case "TCG.Entity.Categories":
             Categories categories = new Categories();
             categories.Id = row["Id"].ToString().Trim();
             categories.ResourceListTemplate = templateHandlers.GetTemplateByID(row["iListTemplate"].ToString());
             categories.iOrder = (int)row["iOrder"];
             categories.Parent = row["Parent"].ToString().Trim();
             categories.ResourceTemplate = templateHandlers.GetTemplateByID(row["iTemplate"].ToString());
             categories.vcClassName = row["vcClassName"].ToString().Trim();
             categories.vcDirectory = row["vcDirectory"].ToString().Trim();
             categories.vcName = row["vcName"].ToString().Trim();
             categories.vcUrl = row["vcUrl"].ToString().Trim();
             categories.dUpdateDate = (DateTime)row["dUpdateDate"];
             categories.cVisible = row["Visible"].ToString().Trim();
             categories.DataBaseService = row["DataBaseService"].ToString().Trim();
             categories.SkinInfo = skinHandlers.GetSkinEntityBySkinId(row["SkinId"].ToString().Trim());
             categories.IsSinglePage = row["IsSinglePage"].ToString().Trim();
             categories.vcPic = row["vcPic"].ToString().Trim();
             categories.vcSpeciality = (row["vcSpeciality"] == null) ? "" : row["vcSpeciality"].ToString();
             return (EntityBase)categories;
         case "TCG.Entity.Resources":
             Resources resources = new Resources();
             resources.Id = row["Id"].ToString();
             resources.vcTitle = row["vcTitle"].ToString();
             resources.Categorie = categoriesHandlers.GetCategoriesById(row["iClassID"].ToString());
             resources.vcUrl = (string)row["vcUrl"].ToString();
             resources.vcContent = (string)row["vcContent"].ToString().Trim();
             resources.vcAuthor = (string)row["vcAuthor"].ToString().Trim();
             resources.iCount = (int)row["iCount"];
             resources.vcKeyWord = (string)row["vcKeyWord"].ToString().Trim();
             resources.vcEditor = (string)row["vcEditor"].ToString().Trim();
             resources.cCreated = (string)row["cCreated"].ToString().Trim();
             resources.vcSmallImg = (string)row["vcSmallImg"].ToString().Trim();
             resources.vcBigImg = (string)row["vcBigImg"].ToString().Trim();
             resources.vcShortContent = (string)row["vcShortContent"].ToString().Trim();
             resources.vcSpeciality = (string)row["vcSpeciality"].ToString().Trim();
             resources.cChecked = (string)row["cChecked"].ToString().Trim();
             resources.cDel = (string)row["cDel"].ToString().Trim();
             resources.cPostByUser = (string)row["cPostByUser"].ToString().Trim();
             resources.vcFilePath = (string)row["vcFilePath"].ToString().Trim();
             resources.dAddDate = (DateTime)row["dAddDate"];
             resources.dUpDateDate = (DateTime)row["dUpDateDate"];
             resources.vcTitleColor = (string)row["vcTitleColor"].ToString().Trim();
             resources.cStrong = (string)row["cStrong"].ToString().Trim();
             resources.SheifUrl = (string)row["SheifUrl"].ToString().Trim();
             resources.PropertiesCategorieId = objectHandlers.ToInt(row["PropertiesCategorieId"]);
             resources.CCCategories = row["CCCategories"].ToString();
             CachingService.Set(resources.Id, resources, null);
             return (EntityBase)resources;
         case "TCG.Entity.Template":
             Template template = new Template();
             template.Id = row["Id"].ToString();
             template.SkinInfo = skinHandlers.GetSkinEntityBySkinId(row["SkinId"].ToString());
             template.TemplateType = templateHandlers.GetTemplateType((int)row["TemplateType"]);
             template.iParentId = row["iParentId"].ToString();
             template.iSystemType = (int)row["iSystemType"];
             template.vcTempName = (string)row["vcTempName"];
             template.Content = (string)row["vcContent"];
             template.vcUrl = (string)row["vcUrl"];
             template.dAddDate = (DateTime)row["dAddDate"];
             template.dUpdateDate = (DateTime)row["dUpdateDate"];
             return (EntityBase)template;
         case "TCG.Entity.Skin":
             Skin skin = new Skin();
             skin.Id = row["Id"].ToString().Trim();
             skin.Name = row["Name"].ToString().Trim();
             skin.Pic = row["Pic"].ToString().Trim();
             skin.WebDescription = row["WebDescription"].ToString().Trim();
             skin.Filename = row["Filename"].ToString().Trim();
             skin.WebKeyWords = row["WebKeyWords"].ToString().Trim();
             skin.IndexPage = row["IndexPage"].ToString().Trim();
             return (EntityBase)skin;
         case "TCG.Entity.SheifSourceInfo":
             SheifSourceInfo sourceinfo = new SheifSourceInfo();
             sourceinfo.Id = row["ID"].ToString().Trim();
             sourceinfo.SourceName = row["SourceName"].ToString().Trim();
             sourceinfo.SourceUrl = row["SourceUrl"].ToString().Trim();
             sourceinfo.CharSet = row["CharSet"].ToString().Trim();
             sourceinfo.ListAreaRole = row["ListAreaRole"].ToString().Trim();
             sourceinfo.TopicListRole = row["TopicListRole"].ToString().Trim();
             sourceinfo.TopicListDataRole = row["TopicListDataRole"].ToString().Trim();
             sourceinfo.TopicRole = row["TopicRole"].ToString().Trim();
             sourceinfo.TopicDataRole = row["TopicDataRole"].ToString().Trim();
             sourceinfo.TopicPagerOld = row["TopicPagerOld"].ToString().Trim();
             sourceinfo.TopicPagerTemp = row["TopicPagerTemp"].ToString().Trim();
             sourceinfo.IsRss = (bool)row["IsRss"];
             return (EntityBase)sourceinfo;
         case "TCG.Entity.FileCategories":
         //FileCategories filecagegories = new FileCategories();
         //filecagegories.Id = row["iId"].ToString();
         //filecagegories.iParentId = objectHandlers.ToInt(row["iParentId"]);
         //filecagegories.dCreateDate = objectHandlers.ToTime(row["dCreateDate"].ToString());
         //filecagegories.vcFileName = row["vcFileName"].ToString().Trim();
         //filecagegories.vcMeno = row["vcMeno"].ToString().Trim();
         //filecagegories.vcKey = row["vcKey"].ToString().Trim();
         //filecagegories.MaxSpace = objectHandlers.ToLong(row["MaxSpace"]);
         //filecagegories.Space = objectHandlers.ToLong(row["Space"]);
         //return (EntityBase)filecagegories;
         case "TCG.Entity.FileResources":
         //FileResources fileresource = new FileResources();
         //fileresource.Id = row["iID"].ToString().Trim();
         //fileresource.iClassId = (int)row["iClassId"];
         //fileresource.iSize = (int)row["iSize"];
         //fileresource.vcFileName = row["vcFileName"].ToString().Trim();
         //fileresource.vcIP = row["vcIP"].ToString().Trim();
         //fileresource.vcType = row["vcType"].ToString().Trim();
         //fileresource.iRequest = (int)row["iRequest"];
         //fileresource.iDowns = (int)row["iDowns"];
         //fileresource.dCreateDate = (DateTime)row["dCreateDate"];
         //return (EntityBase)fileresource;
         case "TCG.Entity.SheifCategorieConfig":
             SheifCategorieConfig sheifcategorieconfig = new SheifCategorieConfig();
             sheifcategorieconfig.Id = row["Id"].ToString();
             sheifcategorieconfig.SheifSourceId = row["SheifSourceId"].ToString().Trim();
             sheifcategorieconfig.LocalCategorieId = row["LocalCategorieId"].ToString().Trim();
             sheifcategorieconfig.ResourceCreateDateTime = objectHandlers.ToTime(row["ResourceCreateDateTime"].ToString().Trim());
             return (EntityBase)sheifcategorieconfig;
         case "TCG.Entity.Properties":
             Properties categorieProperties = new Properties();
             categorieProperties.Id = row["Id"].ToString();
             categorieProperties.ProertieName = row["ProertieName"].ToString();
             categorieProperties.PropertiesCategorieId = row["PropertiesCategorieId"].ToString();
             categorieProperties.Type = row["Type"].ToString();
             categorieProperties.Values = row["Values"].ToString();
             categorieProperties.width = objectHandlers.ToInt(row["width"].ToString());
             categorieProperties.height = objectHandlers.ToInt(row["height"].ToString());
             categorieProperties.iOrder = objectHandlers.ToInt(row["iOrder"].ToString());
             return (EntityBase)categorieProperties;
         case "TCG.Entity.ResourceProperties":
             ResourceProperties rategorieProperties = new ResourceProperties();
             rategorieProperties.Id = row["Id"].ToString();
             rategorieProperties.ResourceId = row["ResourceId"].ToString();
             rategorieProperties.PropertieName = row["PropertieName"].ToString();
             rategorieProperties.PropertieValue = row["PropertieValue"].ToString();
             rategorieProperties.PropertieId = objectHandlers.ToInt(row["PropertieId"].ToString());
             rategorieProperties.iOrder = objectHandlers.ToInt(row["iOrder"].ToString());
             return (EntityBase)rategorieProperties;
         case "TCG.Entity.PropertiesCategorie":
             PropertiesCategorie pc = new PropertiesCategorie();
             pc.CategoriePropertiesName = row["CategoriePropertiesName"].ToString();
             pc.Id = row["Id"].ToString();
             pc.Visible = row["Visible"].ToString();
             pc.Visible = row["Visible"].ToString();
             return (EntityBase)pc;
         case "TCG.Entity.Speciality":
             Speciality speciality = new Speciality();
             speciality.Id = row["Id"].ToString();
             speciality.SkinId = (string)row["SkinId"];
             speciality.iParent = (int)row["iParent"];
             speciality.vcTitle = (string)row["vcTitle"];
             speciality.vcExplain = (string)row["vcExplain"];
             speciality.dUpDateDate = (DateTime)row["dUpDateDate"];
             return (EntityBase)speciality;
         case "TCG.Entity.FeedBack":
             FeedBack feedBack = new FeedBack();
             feedBack.Id = row["Id"].ToString();
             feedBack.UserName = row["UserName"].ToString();
             feedBack.Tel = row["Tel"].ToString();
             feedBack.QQ = row["QQ"].ToString();
             feedBack.Content = row["Content"].ToString();
             feedBack.AddDate = objectHandlers.ToTime(row["AddDate"].ToString());
             feedBack.Ip = row["Ip"].ToString();
             feedBack.SkinId = row["SkinId"].ToString();
             feedBack.Title = row["Title"].ToString();
             feedBack.Email = row["Email"].ToString();
             return (EntityBase)feedBack;
     }
     return null;
 }