Ejemplo n.º 1
0
 private void LoadSpecialData(int pID)
 {
     txtSystem.Text = ServiceDAO.Find(pID).Name;
     txten.Text     = LocalizedPropertyDAO.Find(pID, 1, "Service", "Title").LocaleValue;
     txtjp.Text     = LocalizedPropertyDAO.Find(pID, 2, "Service", "Title").LocaleValue;
     txtvi.Text     = LocalizedPropertyDAO.Find(pID, 3, "Service", "Title").LocaleValue;
     ckFullen.Text  = LocalizedPropertyDAO.Find(pID, 1, "Service", "Body") == null ? "" : LocalizedPropertyDAO.Find(pID, 1, "Service", "Body").LocaleValue;
     ckFulljp.Text  = LocalizedPropertyDAO.Find(pID, 2, "Service", "Body") == null ? "" : LocalizedPropertyDAO.Find(pID, 2, "Service", "Body").LocaleValue;;
     ckFullvi.Text  = LocalizedPropertyDAO.Find(pID, 3, "Service", "Body") == null ? "" : LocalizedPropertyDAO.Find(pID, 3, "Service", "Body").LocaleValue;;
 }
Ejemplo n.º 2
0
        private void LoadSpecialData(int pID)
        {
            txtSystem.Text = ContentDAO.Find(pID).Title;

            txten.Text    = LocalizedPropertyDAO.Find(pID, 1, "Content", "Title") == null ? "" : LocalizedPropertyDAO.Find(pID, 1, "Content", "Title").LocaleValue;
            txtjp.Text    = LocalizedPropertyDAO.Find(pID, 2, "Content", "Title") == null ? "" : LocalizedPropertyDAO.Find(pID, 2, "Content", "Title").LocaleValue;
            txtvi.Text    = LocalizedPropertyDAO.Find(pID, 3, "Content", "Title") == null ? "" : LocalizedPropertyDAO.Find(pID, 3, "Content", "Title").LocaleValue;
            ckFullen.Text = LocalizedPropertyDAO.Find(pID, 1, "Content", "Body").LocaleValue;
            ckFulljp.Text = LocalizedPropertyDAO.Find(pID, 2, "Content", "Body").LocaleValue;
            ckFullvn.Text = LocalizedPropertyDAO.Find(pID, 3, "Content", "Body").LocaleValue;
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int l;
                if (Request.Cookies["l"] != null)
                {
                    l = int.Parse(Request.Cookies["l"].Value);
                }
                else
                {
                    HttpContext.Current.Response.Cookies.Add(new HttpCookie("l", "1"));
                    l = 1;
                }
                string cate = Common.RequestID("cate");
                if (Common.RequestID("id") != "")
                {
                    var id = Common.RequestID("id");
                    switch (cate)
                    {
                    case "c":
                        var x = ContentDAO.Find(id);
                        var y = LocalizedPropertyDAO.Find(x.Id, l, "Content", "Body");
                        var t = LocalizedPropertyDAO.Find(x.Id, l, "Content", "Title").LocaleValue;
                        Page.Title    = t + Resources.language.title_separator + Resources.language.website_name;
                        Literal1.Text = y.LocaleValue;
                        break;

                    case "s":
                        var z = ServiceDAO.Find(id);
                        Literal1.Text = LocalizedPropertyDAO.Find(z.Id, l, "Service", "Body") == null ? "":LocalizedPropertyDAO.Find(z.Id, l, "Service", "Body").LocaleValue;
                        var title = LocalizedPropertyDAO.Find(z.Id, l, "Service", "Title").LocaleValue;
                        Page.Title = title + Resources.language.title_separator + Resources.language.website_name;
                        break;
                    }
                }
                else
                {
                    var z = ContentDAO.Find("default");
                    Literal1.Text = LocalizedPropertyDAO.Find(z.Id, l, "Content", "Body") == null ? "" : LocalizedPropertyDAO.Find(z.Id, l, "Content", "Body").LocaleValue;
                    var t = LocalizedPropertyDAO.Find(z.Id, l, "Content", "Title").LocaleValue;
                    Page.Title = t + Resources.language.title_separator + Resources.language.website_name;
                    content.Controls.AddAt(0, LoadControl(NivoSliderControl));
                }
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int l;
                if (Request.Cookies["l"] != null)
                {
                    l = int.Parse(Request.Cookies["l"].Value);
                }
                else
                {
                    HttpContext.Current.Response.Cookies.Add(new HttpCookie("l", "1"));
                    l = 1;
                }
                switch (l)
                {
                case 1:
                    Label1.Text = "Services";
                    break;

                case 2:
                    Label1.Text = "サービス";
                    break;

                case 3:
                    Label1.Text = "Dịch vụ";
                    break;
                }

                var list = new List <ServiceModel>();
                var x    = ServiceDAO.Get();
                foreach (var service in x)
                {
                    list.Add(new ServiceModel()
                    {
                        Name        = service.Name,
                        LocaleValue = LocalizedPropertyDAO.Find(service.Id, l, "Service", "Title").LocaleValue
                    });
                }
                repeater.DataSource = list;
                repeater.DataBind();
            }
        }
Ejemplo n.º 5
0
        private void Save(string type)
        {
            if (Validate())
            {
                #region Insert SanPham

                if (_id != 0)
                {
                    ServiceDAO.Find(_id).Name = txtSystem.Text;
                    if (LocalizedPropertyDAO.Find(_id, 1, "Service", "Title") != null)
                    {
                        LocalizedPropertyDAO.Find(_id, 1, "Service", "Title").LocaleValue = txten.Text;
                    }
                    if (LocalizedPropertyDAO.Find(_id, 2, "Service", "Title") != null)
                    {
                        LocalizedPropertyDAO.Find(_id, 2, "Service", "Title").LocaleValue = txtjp.Text;
                    }
                    if (LocalizedPropertyDAO.Find(_id, 3, "Service", "Title") != null)
                    {
                        LocalizedPropertyDAO.Find(_id, 3, "Service", "Title").LocaleValue = txtvi.Text;
                    }
                    if (LocalizedPropertyDAO.Find(_id, 1, "Service", "Body") != null)
                    {
                        LocalizedPropertyDAO.Find(_id, 1, "Service", "Body").LocaleValue = ckFullen.Text;
                    }
                    if (LocalizedPropertyDAO.Find(_id, 2, "Service", "Body") != null)
                    {
                        LocalizedPropertyDAO.Find(_id, 2, "Service", "Body").LocaleValue = ckFulljp.Text;
                    }
                    if (LocalizedPropertyDAO.Find(_id, 3, "Service", "Body") != null)
                    {
                        LocalizedPropertyDAO.Find(_id, 3, "Service", "Body").LocaleValue = ckFullvi.Text;
                    }
                    ArticleDAO.Update();
                }
                else
                {
                    var x = new DAO.Service
                    {
                        Name = txtSystem.Text
                    };
                    ServiceDAO.Insert(x);
                    LocalizedPropertyDAO.Insert(new LocalizedProperty
                    {
                        EntityId       = x.Id,
                        LanguageId     = 1,
                        LocaleKeyGroup = "Service",
                        LocaleKey      = "Title",
                        LocaleValue    = txten.Text
                    });
                    LocalizedPropertyDAO.Insert(new LocalizedProperty
                    {
                        EntityId       = x.Id,
                        LanguageId     = 2,
                        LocaleKeyGroup = "Service",
                        LocaleKey      = "Title",
                        LocaleValue    = txtjp.Text
                    });
                    LocalizedPropertyDAO.Insert(new LocalizedProperty
                    {
                        EntityId       = x.Id,
                        LanguageId     = 3,
                        LocaleKeyGroup = "Service",
                        LocaleKey      = "Title",
                        LocaleValue    = txtvi.Text
                    });
                    LocalizedPropertyDAO.Insert(new LocalizedProperty
                    {
                        EntityId       = x.Id,
                        LanguageId     = 1,
                        LocaleKeyGroup = "Service",
                        LocaleKey      = "Body",
                        LocaleValue    = ckFullen.Text
                    });
                    LocalizedPropertyDAO.Insert(new LocalizedProperty
                    {
                        EntityId       = x.Id,
                        LanguageId     = 2,
                        LocaleKeyGroup = "Service",
                        LocaleKey      = "Body",
                        LocaleValue    = ckFulljp.Text
                    });
                    LocalizedPropertyDAO.Insert(new LocalizedProperty
                    {
                        EntityId       = x.Id,
                        LanguageId     = 3,
                        LocaleKeyGroup = "Service",
                        LocaleKey      = "Body",
                        LocaleValue    = ckFullvi.Text
                    });
                }

                #endregion

                if (type == "Publish")
                {
                    Response.Redirect("/AppAdmin/Service/Index.aspx");
                }
                else if (type == "Save")
                {
                    Response.Redirect("/AppAdmin/Service/Index.aspx");
                }
            }
            else
            {
                iRightAccess.Visible = false;
                ObjControl.LoadMyControl(idNotPermissionAccess, NotPermissControl);
            }
        }