Exemple #1
0
    private static Vector4[] GenerateModelPlacementPointsScattered(Config_Model model, uint amount)
    {
        float minX = model.Mesh.bounds.extents.x;
        float minZ = model.Mesh.bounds.extents.z;

        return(GeneratePointsScattered(minX, minZ, amount));
    }
Exemple #2
0
        [Authorize(Roles = "Admin")]  //Personnel phan quyen
        public JsonResult Update(string Id, string Mail_Smtp, string Mail_Port, string Mail_Info,
                                 string Mail_Noreply, string Mail_Password, string PlaceHead,
                                 string PlaceBody, string GoogleId, string Contact, string DeliveryTerms, string PaymentTerms,
                                 string FreeShipping, string Copyright, string Title, string Description, string Keyword,
                                 string Lang, string Helpsize, string Location, string ToolScrip, string Icon,
                                 string pageging1, string pageging2, string pageging3, string pageging4, string pageging5)
        {
            Config_Model data = new Config_Model();//gọi model data

            data.Id            = Convert.ToInt16(Id);
            data.Mail_Smtp     = Mail_Smtp;
            data.Mail_Smtp     = Mail_Smtp;
            data.Mail_Port     = Convert.ToInt16(Mail_Port);
            data.Mail_Info     = Mail_Info;
            data.Mail_Noreply  = Mail_Noreply;
            data.Mail_Password = Mail_Password;
            data.PlaceHead     = Server.HtmlDecode(PlaceHead);
            data.PlaceBody     = Server.HtmlDecode(PlaceBody);
            data.GoogleId      = GoogleId;
            data.Contact       = Contact;
            data.DeliveryTerms = Server.HtmlDecode(DeliveryTerms);
            data.PaymentTerms  = Server.HtmlDecode(PaymentTerms);
            data.FreeShipping  = Convert.ToDouble(FreeShipping);
            data.Copyright     = Server.HtmlDecode(Copyright);
            data.Title         = Title;
            data.Description   = Description;
            data.Keyword       = Keyword;
            data.Lang          = Lang;
            data.Helpsize      = Server.HtmlDecode(Helpsize);
            data.Location      = Convert.ToInt16(Location);
            data.ToolScrip     = Server.HtmlDecode(ToolScrip);
            data.Icon          = Icon;
            data.pageging1     = Convert.ToInt32(pageging1);
            data.pageging2     = Convert.ToInt32(pageging2);
            data.pageging3     = Convert.ToInt32(pageging3);
            data.pageging4     = Convert.ToInt32(pageging4);
            data.pageging5     = Convert.ToInt32(pageging5);

            Connect.Update(data); //gọi service lưu

            //Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Request.ApplicationPath);
            //config.AppSettings.Settings.Remove("pagenews");
            //config.AppSettings.Settings.Add("pagenews", pagenews); //tin tức

            //config.AppSettings.Settings.Remove("pageproduct");
            //config.AppSettings.Settings.Add("pageproduct", pageproduct); //sản phẩm

            //config.AppSettings.Settings.Remove("pageservice");
            //config.AppSettings.Settings.Add("pageservice", pageservice); //dịch vụ

            //config.AppSettings.Settings.Remove("pagesupport");
            //config.AppSettings.Settings.Add("pagesupport", pagesupport); //hỗ trợ
            //config.Save();


            Resurt = 1;
            return(Json(Resurt, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// 更新配置
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int UpdateConfig(Config_Model model)
        {
            string sql = "update WebRegexConfig set ListUrl=@ListUrl,ContUrl=@ContUrl,ListRule=@ListRule,ContRule=@ContRule,SourceWeb=@SourceWeb,Series=@Series,RegexName=@RegexName where ID=@ID";

            SqlParameter[] pars = new SqlParameter[] {
                new SqlParameter("@ListUrl", model.ListUrl),
                new SqlParameter("@ContUrl", model.ContUrl),
                new SqlParameter("@ListRule", model.ContUrl),
                new SqlParameter("@ContRule", model.ContRule),
                new SqlParameter("@SourceWeb", model.SourceWeb),
                new SqlParameter("@RegexName", model.RegexName),
                new SqlParameter("@ID", model.ID),
                new SqlParameter("@Series", model.Series)
            };
            return(BLL.ExecuteNonQuery(sql, pars));
        }
        /// <summary>
        /// 添加配置
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddConfig(Config_Model model)
        {
            string sql = "insert WebRegexConfig (Userid,ListUrl,ContUrl,ListRule,ContRule,SourceWeb,RegexName,Series)values            (@Userid,@ListUrl,@ContUrl,@ListRule,@ContRule,@SourceWeb,@RegexName,@Series)";

            SqlParameter[] pars = new SqlParameter[] {
                new SqlParameter("@Userid", model.Userid),
                new SqlParameter("@ListUrl", model.ListUrl),
                new SqlParameter("@ContUrl", model.ContUrl),
                new SqlParameter("@ListRule", model.ListRule),
                new SqlParameter("@ContRule", model.ContRule),
                new SqlParameter("@SourceWeb", model.SourceWeb),
                new SqlParameter("@RegexName", model.RegexName),
                new SqlParameter("@Series", model.Series)
            };
            return(BLL.ExecuteNonQuery(sql, pars));
        }
        public void Create(Config_Model model)
        {
            var data = Connect_Enttity.Configs.FirstOrDefault(x => x.Id == model.Id);

            if (data == null)
            {
                var entity = new Config();
                entity.Mail_Smtp     = model.Mail_Smtp;
                entity.Mail_Port     = (short)(model.Mail_Port);
                entity.Mail_Info     = model.Mail_Info;
                entity.Mail_Noreply  = model.Mail_Noreply;
                entity.Mail_Password = model.Mail_Password;
                entity.PlaceHead     = model.PlaceHead;
                entity.PlaceBody     = model.PlaceBody;
                entity.GoogleId      = model.GoogleId;
                entity.Contact       = model.Contact;
                entity.DeliveryTerms = model.DeliveryTerms;
                entity.PaymentTerms  = model.PaymentTerms;
                entity.FreeShipping  = Convert.ToDouble(model.FreeShipping);
                entity.Copyright     = model.Copyright;
                entity.Title         = model.Title;
                entity.Description   = model.Description;
                entity.Keyword       = model.Keyword;
                entity.Lang          = model.Lang;
                entity.Helpsize      = model.Helpsize;
                entity.Location      = (int)(model.Location);
                entity.ToolScrip     = model.ToolScrip;
                entity.Icon          = model.Icon;
                entity.pageging1     = model.pageging1;
                entity.pageging2     = model.pageging2;
                entity.pageging3     = model.pageging3;
                entity.pageging4     = model.pageging4;
                entity.pageging5     = model.pageging5;

                Connect_Enttity.Configs.Add(entity);
                Connect_Enttity.SaveChanges();
                Dispose();
            }
        }
        public void Update(Config_Model model)
        {
            var data = Connect_Enttity.Configs.FirstOrDefault(x => x.Id == model.Id);

            if (data != null)
            {
                data.Mail_Smtp     = model.Mail_Smtp;
                data.Mail_Port     = (short)(model.Mail_Port);
                data.Mail_Info     = model.Mail_Info;
                data.Mail_Noreply  = model.Mail_Noreply;
                data.Mail_Password = model.Mail_Password;
                data.PlaceHead     = model.PlaceHead;
                data.PlaceBody     = model.PlaceBody;
                data.GoogleId      = model.GoogleId;
                data.Contact       = model.Contact;
                data.DeliveryTerms = model.DeliveryTerms;
                data.PaymentTerms  = model.PaymentTerms;
                data.FreeShipping  = Convert.ToDouble(model.FreeShipping);
                data.Copyright     = model.Copyright;
                data.Title         = model.Title;
                data.Description   = model.Description;
                data.Keyword       = model.Keyword;
                data.Lang          = model.Lang;
                data.Helpsize      = model.Helpsize;
                data.Location      = (int)(model.Location);
                data.ToolScrip     = model.ToolScrip;
                data.Icon          = model.Icon;

                data.pageging1 = model.pageging1;
                data.pageging2 = model.pageging2;
                data.pageging3 = model.pageging3;
                data.pageging4 = model.pageging4;
                data.pageging5 = model.pageging5;

                Connect_Enttity.SaveChanges();
                Dispose();
            }
        }
        public IList <Config_Model> GetId(Config_Model model)
        {
            IList <Config_Model> result = new List <Config_Model>();

            result = Connect_Enttity.Configs.Where(x => x.Id == model.Id).Select(x => new Config_Model
            {
                Id            = x.Id,
                Mail_Smtp     = x.Mail_Smtp,
                Mail_Port     = (short)(x.Mail_Port),
                Mail_Info     = x.Mail_Info,
                Mail_Noreply  = x.Mail_Noreply,
                Mail_Password = x.Mail_Password,
                PlaceHead     = x.PlaceHead,
                PlaceBody     = x.PlaceBody,
                GoogleId      = x.GoogleId,
                Contact       = x.Contact,
                DeliveryTerms = x.DeliveryTerms,
                PaymentTerms  = x.PaymentTerms,
                FreeShipping  = Convert.ToDouble(x.FreeShipping),
                Copyright     = x.Copyright,
                Title         = x.Title,
                Description   = x.Description,
                Keyword       = x.Keyword,
                Lang          = x.Lang,
                Helpsize      = x.Helpsize,
                Location      = (int)(x.Location),
                ToolScrip     = x.ToolScrip,
                Icon          = x.Icon,
                pageging1     = x.pageging1,
                pageging2     = x.pageging2,
                pageging3     = x.pageging3,
                pageging4     = x.pageging4,
                pageging5     = x.pageging5
            }).ToList();

            return(result);
        }
Exemple #8
0
        private string wsynthetical_star = string.Empty; //综合
        #endregion
        public void ProcessRequest(HttpContext context)
        {
            if (context.Request["rgname"] != null)
            {
                rgname = context.Request["rgname"].Trim().ToString();
            }
            if (context.Request["series"] != null)
            {
                series = context.Request["series"].Trim().ToString();
            }
            if (context.Request["source"] != null)
            {
                source = context.Request["source"].Trim().ToString();
            }
            if (context.Request["uid"] != null)
            {
                uid = context.Request["uid"].Trim().ToString();
            }

            #region//listReg
            if (context.Request["txt_seedurl"] != null)
            {
                listurl = context.Request["txt_seedurl"].Trim().ToString();
            }
            if (context.Request["tr_liststart"] != null && context.Request["tr_listend"] != null)
            {
                reg_list = AssemblyReg(context.Request["tr_liststart"].Trim().ToString(), context.Request["tr_listend"].ToString().Trim());
            }
            if (context.Request["tr_userstart"] != null && context.Request["tr_userend"] != null)
            {
                reg_user = AssemblyReg(context.Request["tr_userstart"].Trim().ToString(), context.Request["tr_userend"].ToString().Trim());
            }
            if (context.Request["txt_carstart"] != null && context.Request["txt_carend"] != null)
            {
                reg_car = AssemblyReg(context.Request["txt_carstart"].Trim().ToString(), context.Request["txt_carend"].ToString().Trim());
            }

            if (context.Request["txt_urlstart"] != null && context.Request["txt_urlend"] != null)
            {
                reg_url = AssemblyReg(context.Request["txt_urlstart"].Trim().ToString(), context.Request["txt_urlend"].ToString().Trim());
            }

            if (context.Request["txt_titlestart"] != null && context.Request["txt_titleend"] != null)
            {
                reg_title = AssemblyReg(context.Request["txt_titlestart"].Trim().ToString(), context.Request["txt_titleend"].ToString().Trim());
            }
            #endregion

            #region//contentReg
            if (context.Request["txt_cont_url"] != null)
            {
                conturl = context.Request["txt_cont_url"].Trim().ToString();
            }
            if (context.Request["txt_Ccarstart"] != null && context.Request["txt_Ccarend"] != null)
            {
                car = AssemblyReg(context.Request["txt_Ccarstart"].Trim().ToString(), context.Request["txt_Ccarend"].ToString().Trim());
            }
            if (context.Request["txt_Ctitlestart"] != null && context.Request["txt_Ctitleend"] != null)
            {
                title = AssemblyReg(context.Request["txt_Ctitlestart"].Trim().ToString(), context.Request["txt_Ctitleend"].ToString().Trim());
            }
            if (context.Request["txt_Ctypestart"] != null && context.Request["txt_Ctypeend"] != null)
            {
                type = AssemblyReg(context.Request["txt_Ctypestart"].Trim().ToString(), context.Request["txt_Ctypeend"].ToString().Trim());
            }
            if (context.Request["txt_Cdatestart"] != null && context.Request["txt_Cdateend"] != null)
            {
                buydata = AssemblyReg(context.Request["txt_Cdatestart"].Trim().ToString(), context.Request["txt_Cdateend"].ToString().Trim());
            }
            if (context.Request["txt_Caddstart"] != null && context.Request["txt_Caddend"] != null)
            {
                malladdr = AssemblyReg(context.Request["txt_Caddstart"].Trim().ToString(), context.Request["txt_Caddend"].ToString().Trim());
            }
            if (context.Request["txt_Cpricestart"] != null && context.Request["txt_Cprieceend"] != null)
            {
                price = AssemblyReg(context.Request["txt_Cpricestart"].Trim().ToString(), context.Request["txt_Cprieceend"].ToString().Trim());
            }
            if (context.Request["txt_oilstart"] != null && context.Request["txt_oilend"] != null)
            {
                oil = AssemblyReg(context.Request["txt_oilstart"].Trim().ToString(), context.Request["txt_oilend"].ToString().Trim());
            }
            if (context.Request["txt_oilstarstart"] != null && context.Request["txt_oilstarend"] != null)
            {
                oil_star = AssemblyReg(context.Request["txt_oilstarstart"].Trim().ToString(), context.Request["txt_oilstarend"].ToString().Trim());
            }
            if (context.Request["txt_oilsumstart"] != null && context.Request["txt_oilsumend"] != null)
            {
                oil_sum = AssemblyReg(context.Request["txt_oilsumstart"].Trim().ToString(), context.Request["txt_oilsumend"].ToString().Trim());
            }
            if (context.Request["txt_caozuostartstart"] != null && context.Request["txt_caozuostarend"] != null)
            {
                operation_star = AssemblyReg(context.Request["txt_caozuostartstart"].Trim().ToString(), context.Request["txt_caozuostarend"].ToString().Trim());
            }
            if (context.Request["txt_caozuosumstart"] != null && context.Request["txt_caozuosumend"] != null)
            {
                operation = AssemblyReg(context.Request["txt_caozuosumstart"].Trim().ToString(), context.Request["txt_caozuosumend"].ToString().Trim());
            }
            if (context.Request["txt_coststarstart"] != null && context.Request["txt_costend"] != null)
            {
                costperfor_star = AssemblyReg(context.Request["txt_coststarstart"].Trim().ToString(), context.Request["txt_costend"].ToString().Trim());
            }
            if (context.Request["txt_costsumstart"] != null && context.Request["txt_costsumend"] != null)
            {
                costperfor = AssemblyReg(context.Request["txt_costsumstart"].Trim().ToString(), context.Request["txt_costsumend"].ToString().Trim());
            }
            if (context.Request["txt_powerstarstart"] != null && context.Request["txt_powerstarend"] != null)
            {
                power_star = AssemblyReg(context.Request["txt_powerstarstart"].Trim().ToString(), context.Request["txt_powerstarend"].ToString().Trim());
            }
            if (context.Request["txt_powersumstart"] != null && context.Request["txt_powersumend"] != null)
            {
                power = AssemblyReg(context.Request["txt_powersumstart"].Trim().ToString(), context.Request["txt_powersumend"].ToString().Trim());
            }
            if (context.Request["txt_configstarstart"] != null && context.Request["txt_configstarend"] != null)
            {
                config_star = AssemblyReg(context.Request["txt_configstarstart"].Trim().ToString(), context.Request["txt_configstarend"].ToString().Trim());
            }
            if (context.Request["txt_configsumstart"] != null && context.Request["txt_configsumend"] != null)
            {
                config = AssemblyReg(context.Request["txt_configsumstart"].Trim().ToString(), context.Request["txt_configsumend"].ToString().Trim());
            }
            if (context.Request["txt_comfortstarstart"] != null && context.Request["txt_comfortstarend"] != null)
            {
                comfort_star = AssemblyReg(context.Request["txt_comfortstarstart"].Trim().ToString(), context.Request["txt_comfortstarend"].ToString().Trim());
            }
            if (context.Request["txt_comfortsumstart"] != null && context.Request["txt_comfortsumend"] != null)
            {
                comfort = AssemblyReg(context.Request["txt_comfortsumstart"].Trim().ToString(), context.Request["txt_comfortsumend"].ToString().Trim());
            }
            if (context.Request["txt_spacestarstart"] != null && context.Request["txt_spacestarend"] != null)
            {
                space_star = AssemblyReg(context.Request["txt_spacestarstart"].Trim().ToString(), context.Request["txt_spacestarend"].ToString().Trim());
            }
            if (context.Request["txt_spacesumstart"] != null && context.Request["txt_spacesumend"] != null)
            {
                space = AssemblyReg(context.Request["txt_spacesumstart"].Trim().ToString(), context.Request["txt_spacesumend"].ToString().Trim());
            }
            if (context.Request["txt_apprsstarstart"] != null && context.Request["txt_apprsstarend"] != null)
            {
                appearance_star = AssemblyReg(context.Request["txt_apprsstarstart"].Trim().ToString(), context.Request["txt_apprsstarend"].ToString().Trim());
            }
            if (context.Request["txt_apprssumstart"] != null && context.Request["txt_apprssumend"] != null)
            {
                appearance = AssemblyReg(context.Request["txt_apprssumstart"].Trim().ToString(), context.Request["txt_apprssumend"].ToString().Trim());
            }
            if (context.Request["txt_insidestarstart"] != null && context.Request["txt_insidestarend"] != null)
            {
                inside_star = AssemblyReg(context.Request["txt_insidestarstart"].Trim().ToString(), context.Request["txt_insidestarend"].ToString().Trim());
            }
            if (context.Request["txt_insidesumstart"] != null && context.Request["txt_insidesumend"] != null)
            {
                inside = AssemblyReg(context.Request["txt_insidesumstart"].Trim().ToString(), context.Request["txt_insidesumend"].ToString().Trim());
            }
            if (context.Request["txt_allstarstart"] != null && context.Request["txt_allstarend"] != null)
            {
                synthetical_star = AssemblyReg(context.Request["txt_allstarstart"].Trim().ToString(), context.Request["txt_allstarend"].ToString().Trim());
            }
            if (context.Request["txt_allsumstart"] != null && context.Request["txt_allsumend"] != null)
            {
                synthetical = AssemblyReg(context.Request["txt_allsumstart"].Trim().ToString(), context.Request["txt_allsumend"].ToString().Trim());
            }
            if (context.Request["txt_wallstarstart"] != null && context.Request["txt_wallstarend"] != null)
            {
                wsynthetical_star = AssemblyReg(context.Request["txt_wallstarstart"].Trim().ToString(), context.Request["txt_wallstarend"].ToString().Trim());
            }
            if (context.Request["txt_wallsumstart"] != null && context.Request["txt_wallsumend"] != null)
            {
                wsynthetical = AssemblyReg(context.Request["txt_wallsumstart"].Trim().ToString(), context.Request["txt_wallsumend"].ToString().Trim());
            }
            #endregion

            #region//content对象
            RegexCont_Model contmodel = new RegexCont_Model();
            contmodel.url               = conturl;
            contmodel.title             = title;
            contmodel.car               = car;
            contmodel.type              = type;
            contmodel.buydata           = buydata;
            contmodel.malladdr          = malladdr;//购车地址
            contmodel.price             = price;
            contmodel.oil               = oil;
            contmodel.oil_sum           = oil_sum;    //
            contmodel.operation         = operation;  //操控
            contmodel.costperfor        = costperfor; //性价比
            contmodel.config            = config;
            contmodel.comfort           = comfort;    //舒适度
            contmodel.space             = space;      //
            contmodel.power             = power;      //
            contmodel.appearance        = appearance;
            contmodel.inside            = inside;
            contmodel.synthetical       = synthetical;     //综合
            contmodel.wsynthetical      = wsynthetical;    //综合
            contmodel.oil_star          = oil_star;
            contmodel.operation_star    = operation_star;  //操控
            contmodel.costperfor_star   = costperfor_star; //性价比
            contmodel.config_star       = config_star;
            contmodel.comfort_star      = comfort_star;    //舒适度
            contmodel.space_star        = space_star;      //
            contmodel.power_star        = power_star;      //
            contmodel.appearance_star   = appearance_star;
            contmodel.inside_star       = inside_star;
            contmodel.synthetical_star  = synthetical_star;  //综合
            contmodel.wsynthetical_star = wsynthetical_star; //综合
            string contentjson = JsonConvert.SerializeObject(contmodel);
            #endregion

            #region//list对象
            RegexList_Model listmodel = new RegexList_Model();
            listmodel.url       = listurl;
            listmodel.userRule  = reg_user;
            listmodel.urlRule   = reg_url;
            listmodel.carRule   = reg_car;
            listmodel.titleRule = reg_title;
            listmodel.listRule  = reg_list;
            string listjson = JsonConvert.SerializeObject(listmodel);
            #endregion

            Config_Model configmodel = new Config_Model();
            configmodel.ID        = id;
            configmodel.Userid    = uid;
            configmodel.ListUrl   = listurl;
            configmodel.ListRule  = listjson;
            configmodel.ContRule  = contentjson;
            configmodel.ContUrl   = conturl;
            configmodel.SourceWeb = source;
            configmodel.Series    = series;
            configmodel.RegexName = rgname;
            if (id == "0")
            {
                BLL.AddConfig(configmodel);
            }
            else
            {
                BLL.UpdateConfig(configmodel);
            }

            context.Response.ContentType     = "application/json";
            context.Response.ContentEncoding = Encoding.UTF8;
            context.Response.Write(contentjson);
            context.Response.End();
        }
 public IEnumerable <Config_Model> ReadID(Config_Model model)
 {
     return(GetId(model));
 }
Exemple #10
0
 /// <summary>
 /// 更新配置
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int UpdateConfig(Config_Model model)
 {
     return(BLL.UpdateConfig(model));
 }
Exemple #11
0
 /// <summary>
 /// 添加配置
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int AddConfig(Config_Model model)
 {
     return(BLL.AddConfig(model));
 }