[Authorize(Roles = "Admin,Personnel")] //Personnel public ActionResult Update(string IDthuonghieu, string Tenthuonghieu, string Logo, string Url, string Active, string Vitri, string Lienkettinh, string mota, string Lang, string Tenthuonghieu_En, string mota_En) { Thuonghieu_Model data = new Thuonghieu_Model();//gọi model data data.IDthuonghieu = Convert.ToInt32(IDthuonghieu); data.Tenthuonghieu = Tenthuonghieu; data.Logo = Logo; data.Url = Url; data.Active = Convert.ToBoolean(Active); data.Vitri = Convert.ToInt32(Vitri); data.Lienkettinh = UrlRewrite.GenShortName(data.Tenthuonghieu.Replace(":", "").Trim()); data.mota = mota; data.Lang = Lang; data.Tenthuonghieu_En = Tenthuonghieu_En; data.mota_En = mota_En; if (connect_entity.Thuonghieux.FirstOrDefault (x => x.Tenthuonghieu == data.Tenthuonghieu && x.IDthuonghieu != data.IDthuonghieu) == null) // kiểm tra không được trùng tên { Connect.Update(data); //gọi service lưu Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string Thuoctinh, string Idtinhang, string Active, string Ord, string Title, string Content) { DientuTinhnang_Model data = new DientuTinhnang_Model();//gọi model data if (Idtinhang == "") { Idtinhang = "0"; } data.Idthuoctinh = Convert.ToInt32(Id); data.Thuoctinh = Thuoctinh; data.Thuoctinh = Thuoctinh; data.Title = UrlRewrite.GenShortName(data.Thuoctinh.Replace(":", "").Trim()); data.Idtinhang = Convert.ToInt32(Idtinhang == "0" ? "0" : Idtinhang); //Id select ajax product if (data.Idtinhang == 0) { data.Idthuoctinhselect = 0; } else { data.Idthuoctinhselect = GetIdmax(Convert.ToInt32(data.Idtinhang)); } data.Active = Convert.ToBoolean(Active); data.Ord = Convert.ToInt32(Ord); data.Title = Title; data.Content = Content; Connect.Update(data); //gọi service lưu Resurt = 1; return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string Name, string Tag, string Image, string Content, string Detail, string Date, string Title, string Description, string Keyword, string Priority, string Index, string Active, string ord, string Nguon, string Lang, string Image1, string Image2, string Image3, string Image4, string Image5, string GroupNewsCatTag, string Cateprolevel1, string Cateprolevel2, string Cateprolevel3, string NameEn, string ContentEn, string DetailEn, string DateView, string Luotxem) { GroupNewsNewsDetail_Model data = new GroupNewsNewsDetail_Model();//gọi model data data.Id = Convert.ToInt32(Id); data.Name = Name; data.Tag = UrlRewrite.GenShortName(data.Name.Replace(":", "").Trim()); data.Image = Image; data.Content = Content; data.Detail = Detail; data.Date = DateTime.Now;//Convert.ToDateTime(Date); data.Title = Title; data.Description = Description; data.Keyword = Keyword; data.Priority = Convert.ToInt32(Priority); data.Index = Convert.ToInt32(Index); data.Active = Convert.ToInt32(Active); data.ord = Convert.ToInt32(ord); data.Nguon = Nguon; data.Lang = Lang; data.Image1 = Image1; data.Image2 = Image2; data.Image3 = Image3; data.Image4 = Image4; data.Image5 = Image5; data.GroupNewsCatTag = GroupNewsCatTag; // Lever for catelog 1 and catelog 2 and catelog 3 Cateprolevel1 = Resurt_Cateprolevel1(Convert.ToInt32(GroupNewsCatTag)); Cateprolevel2 = Resurt_Cateprolevel2(Convert.ToInt32(GroupNewsCatTag)); Cateprolevel3 = Resurt_Cateprolevel3(Convert.ToInt32(GroupNewsCatTag)); // data.Cateprolevel1 = Cateprolevel1; data.Cateprolevel2 = Cateprolevel2; data.Cateprolevel3 = Cateprolevel3; data.NameEn = NameEn; data.ContentEn = ContentEn; data.DetailEn = DetailEn; data.DateView = Resurt_Date(Convert.ToInt32(Id)); data.Luotxem = Resurt_View(Convert.ToInt32(Id)); if (connect_entity.GroupNewsNewsDetails.FirstOrDefault (x => x.Name == data.Name && x.Id != data.Id) == null) // kiểm tra không được trùng tên { Connect.Update(data); //gọi service lưu Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Insert(string Name, string Tag, string Level, string Title, string Description, string Keyword, string Ord, string Priority, string Index, string Active, string Lang, string Logogroup, string NameEn, string TitleEn, string ImagesLogo, string content, string contentEn, string Level2) { GroupNew_Model data = new GroupNew_Model();//gọi model data data.Name = Name; data.Tag = UrlRewrite.GenShortName(data.Name.Replace(":", "").Trim()); if (Level2 == "" || Level2 == null) { data.Level = Level == "" ? null : Level; } else { data.Level = Level2 == "" ? null : Level2; } data.Title = Title; data.Description = Description; data.Keyword = Keyword; data.Ord = Convert.ToInt32(Ord); data.Priority = Convert.ToInt32(Priority); data.Index = Convert.ToInt32(Index); data.Active = Convert.ToInt32(Active); data.Lang = Lang; data.Logogroup = Logogroup; data.ImagesLogo = ImagesLogo; data.content = content; data.NameEn = NameEn; data.TitleEn = TitleEn; data.contentEn = contentEn; if (connect_entity.GroupNews.FirstOrDefault (x => x.Name == data.Name) == null) // kiểm tra không được trùng tên { Connect.Create(data); //gọi service lưu Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string Name, string Tag, string Level, string Title, string Description, string Keyword, string Ord, string Priority, string Index, string Active, string Lang, string Logogroup, string NameEn, string TitleEn, string ImagesLogo, string content, string contentEn) { GroupNew_Model data = new GroupNew_Model();//gọi model data data.Id = Convert.ToInt32(Id); data.Name = Name; data.Tag = UrlRewrite.GenShortName(data.Name.Replace(":", "").Trim()); data.Level = Level == "" ? null : Level; data.Title = Title; data.Description = Description; data.Keyword = Keyword; data.Ord = Convert.ToInt32(Ord); data.Priority = Convert.ToInt32(Priority); data.Index = Convert.ToInt32(Index); data.Active = Convert.ToInt32(Active); data.Lang = Lang; data.Logogroup = Logogroup; data.ImagesLogo = ImagesLogo; data.content = content; data.NameEn = NameEn; data.TitleEn = TitleEn; data.contentEn = contentEn; if (connect_entity.GroupNews.FirstOrDefault (x => x.Name == data.Name && x.Id != data.Id) == null) // kiểm tra không được trùng tên { string tag_Pre = resurt_tag(data.Id); // lấy giá trị tag trước Connect.Update(data); //gọi service lưu //update to news detail other group save Resurt_Cateprolevel1(tag_Pre, data.Tag); Resurt_Cateprolevel2(tag_Pre, data.Tag); Resurt_Cateprolevel3(tag_Pre, data.Tag); Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string MenuName, string Tag, string Level, string Logogroup, string Ord, string Active, string Mota, string Url, string idThuoctinh, string Priority, string Index, string Level2, string Title, string Keyword, string Description) { DientuMenuSitemathang_Model data = new DientuMenuSitemathang_Model();//gọi model data data.Id = Convert.ToInt32(Id); data.MenuName = MenuName; data.Tag = UrlRewrite.GenShortName(data.MenuName.Replace(":", "").Trim()); data.Level = Level == "" ? null : Level; data.Logogroup = Logogroup; data.Ord = Convert.ToInt32(Ord); data.Active = Convert.ToBoolean(Active); data.Mota = Mota; data.Url = Url; data.idThuoctinh = Convert.ToInt32(idThuoctinh); data.Priority = Convert.ToInt32(Priority); data.Index = Convert.ToInt32(Index); data.Title = Title; data.Keyword = Keyword; data.Description = Description; if (connect_entity.DientuMenuSitemathangs.FirstOrDefault (x => x.MenuName == data.MenuName && x.Id != data.Id) == null) // kiểm tra không được trùng tên { string tag_Pre = resurt_tag(data.Id); // lấy giá trị tag trước Connect.Update(data); //gọi service lưu //update to news detail other group save Resurt_Cateprolevel1(tag_Pre, data.Tag); Resurt_Cateprolevel2(tag_Pre, data.Tag); Resurt_Cateprolevel3(tag_Pre, data.Tag); Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Insert(string MenuName, string Tag, string Level, string Logogroup, string Ord, string Active, string Mota, string Url, string idThuoctinh, string Priority, string Index, string Level2, string Title, string Keyword, string Description) { DientuMenuSitemathang_Model data = new DientuMenuSitemathang_Model();//gọi model data data.MenuName = MenuName; data.Tag = UrlRewrite.GenShortName(data.MenuName.Replace(":", "").Trim()); if (Level2 == "" || Level2 == null) { data.Level = Level == "" ? null : Level; } else { data.Level = Level2 == "" ? null : Level2; } data.Logogroup = Logogroup; data.Ord = Convert.ToInt32(Ord); data.Active = Convert.ToBoolean(Active); data.Mota = Mota; data.Url = Url; data.idThuoctinh = Convert.ToInt32(idThuoctinh); data.Priority = Convert.ToInt32(Priority); data.Index = Convert.ToInt32(Index); data.Title = Title; data.Keyword = Keyword; data.Description = Description; if (connect_entity.DientuMenuSitemathangs.FirstOrDefault (x => x.MenuName == data.MenuName) == null) // kiểm tra không được trùng tên { Connect.Create(data); //gọi service lưu Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string Name, string Tag, string Ngaydang, string Tomtat, string Noidung, string Tacgia, string Luotxem, string Hinhanh, string Title, string Description, string Keyword, string Active, string Ord, string Type, string Ngayxemganday, string lienkiettinh, string NameEn, string ContentEn, string DetailEn, string Nguon) { Tintuc_Model data = new Tintuc_Model(); //gọi model data data.Id = Convert.ToInt32(Id); data.Name = Name; data.Tag = UrlRewrite.GenShortName(data.Name.Replace(":", "").Trim());; //Tag; data.Ngaydang = null; //xủ lý bên service data.Tomtat = Tomtat; data.Noidung = Noidung; data.Tacgia = Tacgia; data.Luotxem = null; //xủ lý bên service data.Hinhanh = Hinhanh; data.Title = Title; data.Description = Description; data.Keyword = Keyword; data.Active = Convert.ToBoolean(Active); data.Ord = Convert.ToInt32(Ord); data.Type = Convert.ToInt32(Type); data.Ngayxemganday = null; //xủ lý bên service data.lienkiettinh = lienkiettinh; data.NameEn = NameEn; data.ContentEn = ContentEn; data.DetailEn = DetailEn; data.Nguon = Nguon; if (connect_entity.Tintucs.FirstOrDefault (x => x.Name == data.Name && x.Id != data.Id) == null) // kiểm tra không được trùng tên { Connect.Update(data); //gọi service lưu Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string Name, string Image, string Target, string Content, string Detail, string Position, string Click, string Ord, string Active, string Lang, string Title, string Description, string Keyword, string Image1, string Image2, string Image3, string Image4, string Image5, string Index, string Priority, string Tag, string NameEn, string ContentEn, string DetailEn) { information_Model data = new information_Model();//gọi model data data.Id = Convert.ToInt16(Id); data.Name = Name; data.Image = Image; data.Target = Target; data.Content = Content; data.Detail = Detail; data.Position = Convert.ToInt16(Position); data.Click = Convert.ToInt32(Click); data.Ord = Convert.ToInt32(Ord); data.Active = Convert.ToBoolean(Active); data.Lang = Lang; data.Title = Title; data.Description = Description; data.Keyword = Keyword; data.Image1 = Image1; data.Image2 = Image2; data.Image3 = Image3; data.Image4 = Image4; data.Image5 = Image5; data.Index = Convert.ToInt32(Index); data.Priority = Convert.ToInt32(Priority); data.Tag = UrlRewrite.GenShortName(data.Name.Replace(":", "").Trim()); data.NameEn = NameEn; data.ContentEn = ContentEn; data.DetailEn = DetailEn; Connect.Update(data); //gọi service lưu Resurt = 1; return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string Seri, string Tenhang, string Img, string ThumImg, string Thum_img_img, string Idnsx, string Giaban, string Giamua, string Soluong, string Tinhtrang, string Donvi, string Baohanh, string Ngaynhap, string Danhgia, string Luotxem, string Vat, string Lienhe, string Forder, string Baiviet, string Thongso, string Mota, string Giagiam, string Phantramkm, string Title, string Keyword, string Description, string Khuvuc, string thuoctinh, string khuyenmai, string khuyenmai_html, string Ord, string Active, string Idmenu, string Priority, string Index, string Idthuoctinh, string Diemdanhgia, string Ngayxemganday, string Tag, string GroupNewsCatTag, string Cateprolevel1, string Cateprolevel2, string Cateprolevel3) { DientuMathang_Model data = new DientuMathang_Model();//gọi model data data.Id = Convert.ToInt32(Id); data.Seri = Seri; data.Tenhang = Tenhang; data.Img = Img; data.ThumImg = ThumImg; data.Thum_img_img = Thum_img_img; data.Idnsx = Convert.ToInt32(Idnsx); data.Giaban = Convert.ToDouble(Giaban); data.Giamua = Convert.ToDouble(Giamua); data.Soluong = Convert.ToInt32(Soluong); data.Tinhtrang = Tinhtrang; data.Donvi = Donvi; data.Baohanh = Baohanh; //data.Ngaynhap = DateTime.Now; data.Danhgia = Convert.ToInt32(Danhgia); data.Luotxem = Convert.ToInt32(Luotxem); data.Vat = Convert.ToInt32(Vat); data.Lienhe = Lienhe; data.Forder = Forder; data.Baiviet = Baiviet; data.Thongso = Thongso; data.Mota = Mota; data.Giagiam = Convert.ToDouble(Giagiam); data.Phantramkm = Convert.ToDouble(Phantramkm); data.Title = Title; data.Keyword = Keyword; data.Description = Description; data.Khuvuc = Khuvuc; data.thuoctinh = thuoctinh; data.khuyenmai = khuyenmai; data.khuyenmai_html = khuyenmai_html; data.Ord = Convert.ToInt32(Ord); data.Active = Convert.ToInt32(Active); data.Idmenu = Convert.ToInt32(Idmenu); data.Priority = Convert.ToInt32(Priority); data.Index = Convert.ToInt32(Index); data.Idthuoctinh = Convert.ToInt32(Idthuoctinh); data.Diemdanhgia = Diemdanhgia; //data.Ngayxemganday = Ngayxemganday; data.Tag = UrlRewrite.GenShortName(data.Tenhang.Replace(":", "").Trim()); data.GroupNewsCatTag = GroupNewsCatTag; // Lever for catelog 1 and catelog 2 and catelog 3 data.Cateprolevel1 = Resurt_Cateprolevel1(Convert.ToInt32(GroupNewsCatTag)); data.Cateprolevel2 = Resurt_Cateprolevel2(Convert.ToInt32(GroupNewsCatTag)); data.Cateprolevel3 = Resurt_Cateprolevel3(Convert.ToInt32(GroupNewsCatTag)); if (connect_entity.DientuMathangs.FirstOrDefault (x => x.Tenhang == data.Tenhang && x.Id != data.Id) == null) // kiểm tra không được trùng tên { Connect.Update(data); //gọi service lưu Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }
[Authorize(Roles = "Admin,Personnel")] //Personnel phan quyen public JsonResult Update(string Id, string Name, string NameEn, string Tag, string IDthuonghieu, string NguonSanPham, string Mausac, string Kichthuoc, string SanphamCungloai, string Donvi, string Luotdanhgia, string Video, string Title, string Description, string Keyword, string Priority, string Index, string Order, string Active, string GroupNewsCatTag, string Cateprolevel1, string Cateprolevel2, string Cateprolevel3, string Image, string Image1, string Image2, string Image3, string Image4, string Image5, string Content, string ContentEn, string Detail, string DetailEn, string Khuyenmai, string KhuyenmaiEn, string Baohanh, string BaohanhEn, string DacDiemNoiBat, string DacDiemNoiBatEn, string Thongdiep, string ThongdiepEn, string Seri, string Luotxem, string Soluongmua, string DateCreate, string DateView, string Stock, string Number_Stock, string Vat, string Gianhaphang, string Giaban, string Phantramkhuyenmai, string Giabankhuyenmai, string DateStart_Event, string DateEnd_Event, string Giaban_Event, string Content_Event, string Content_EventEn) { GroupNewMenuSanPhamDetail_Model data = new GroupNewMenuSanPhamDetail_Model();//gọi model data data.Id = Convert.ToInt32(Id); data.Name = Name; data.NameEn = NameEn; data.Tag = UrlRewrite.GenShortName(data.Name.Replace(":", "").Trim()); data.IDthuonghieu = IDthuonghieu; data.NguonSanPham = NguonSanPham; data.Mausac = Mausac; data.Kichthuoc = Kichthuoc; data.SanphamCungloai = SanphamCungloai; data.Donvi = Donvi; data.Luotdanhgia = Luotdanhgia; data.Video = Video; data.Title = Title; data.Description = Description; data.Keyword = Keyword; data.Priority = Convert.ToInt32(Priority); data.Index = Convert.ToInt32(Index); data.Order = Convert.ToInt32(Order); data.Active = Convert.ToInt32(Active); data.GroupNewsCatTag = GroupNewsCatTag; // Lever for catelog 1 and catelog 2 and catelog 3 Cateprolevel1 = Resurt_Cateprolevel1(Convert.ToInt32(GroupNewsCatTag)); Cateprolevel2 = Resurt_Cateprolevel2(Convert.ToInt32(GroupNewsCatTag)); Cateprolevel3 = Resurt_Cateprolevel3(Convert.ToInt32(GroupNewsCatTag)); // data.Cateprolevel1 = Cateprolevel1; data.Cateprolevel2 = Cateprolevel2; data.Cateprolevel3 = Cateprolevel3; data.Image = Image; data.Image1 = Image1; data.Image2 = Image2; data.Image3 = Image3; data.Image4 = Image4; data.Image5 = Image5; data.Content = Content; data.ContentEn = ContentEn; data.Detail = Detail; data.DetailEn = DetailEn; data.Khuyenmai = Khuyenmai; data.KhuyenmaiEn = KhuyenmaiEn; data.Baohanh = Baohanh; data.BaohanhEn = BaohanhEn; data.DacDiemNoiBat = DacDiemNoiBat; data.DacDiemNoiBatEn = DacDiemNoiBatEn; data.Thongdiep = Thongdiep; data.ThongdiepEn = ThongdiepEn; data.Seri = Seri; data.Luotxem = Resurt_View(Convert.ToInt32(Id)); data.Soluongmua = Resurt_Soluongmua(Convert.ToInt32(Id)); data.DateCreate = Resurt_Date_Create(Convert.ToInt32(Id)); data.DateView = Resurt_Date_view(Convert.ToInt32(Id)); //giá trị data.Stock = Convert.ToInt32(Stock); data.Number_Stock = Convert.ToInt32(Number_Stock); data.Vat = Convert.ToBoolean(Vat); data.Gianhaphang = Convert.ToDouble(Gianhaphang.Replace(",", "")); data.Giaban = Convert.ToDouble(Giaban.Replace(",", "")); data.Phantramkhuyenmai = Convert.ToInt32(Phantramkhuyenmai); data.Giabankhuyenmai = Convert.ToDouble(Giabankhuyenmai.Replace(",", "")); if ((DateEnd_Event != null && DateStart_Event != null) || (DateEnd_Event != "" && DateStart_Event != "")) { try { DateTime DateStart_Event_ = DateTime.ParseExact(DateStart_Event, @"d/M/yyyy", System.Globalization.CultureInfo.InvariantCulture); DateTime DateEnd_Event_ = DateTime.ParseExact(DateEnd_Event, @"d/M/yyyy", System.Globalization.CultureInfo.InvariantCulture); data.DateStart_Event = DateStart_Event_; data.DateEnd_Event = DateEnd_Event_; } catch { Resurt = 3; } } else { data.DateStart_Event = null; data.DateEnd_Event = null; } if (Giaban_Event == "" || DateEnd_Event == "" && DateStart_Event == "") { data.Giaban_Event = 0; } else { data.Giaban_Event = Convert.ToDouble(Giaban_Event.Replace(",", "")); } data.Content_Event = Content_Event; data.Content_EventEn = Content_EventEn; if (connect_entity.GroupNewMenuSanPhamDetails.FirstOrDefault (x => x.Name == data.Name && x.Id != data.Id) == null) // kiểm tra không được trùng tên { Connect.Update(data); //gọi service lưu Resurt = 1; } else { Resurt = 0; } return(Json(Resurt, JsonRequestBehavior.AllowGet)); }