public bool InsertInformation(tblInformation infor)
 {
     return _da.InsertInformation(infor);
 }
 public bool UpdateInformation(tblInformation infor)
 {
     return _da.UpdateInformation(infor);
 }
 partial void UpdatetblInformation(tblInformation instance);
 partial void DeletetblInformation(tblInformation instance);
 partial void InserttblInformation(tblInformation instance);
 public ActionResult ViewContact()
 {
     tblInformation contact = new tblInformation();
     ViewData["Department"] = LoadDataForDropDownList();
     if (TempData["EmailReload"] != null)
     {
     ViewData["EmailReload"] = TempData["EmailReload"];
     }
     if (TempData["Title"] != null)
     {
     ViewData["Title"] = TempData["Title"];
     }
     if (TempData["Sender"] != null)
     {
     ViewData["Sender"] = TempData["Sender"];
     }
     if (TempData["Content"] != null)
     {
     ViewData["Content"] = TempData["Content"];
     }
     if (TempData["EmailInvalid"] != null)
     {
     ViewData["EmailInvalid"] = TempData["EmailInvalid"];
     }
     if (TempData["Message"] != null)
     {
     ViewData["Message"] = TempData["Message"];
     }
     if (Request.Cookies["Culture"] != null && Request.Cookies["Culture"].Value == "en-US")
     {
     contact = _nguyenHiepService.GetInformation(true);
     }
     else
     {
     contact = _nguyenHiepService.GetInformation(false);
     }
     return View(contact);
 }
        public ActionResult EditContact(Guid? newsID)
        {
            tblInformation contact = new tblInformation();
            if (Request.Cookies["Culture"] != null && Request.Cookies["Culture"].Value == "en-US")
            {
                contact = _nguyenHiepService.GetInformation(true);
                if (contact != null)
                {
                    ViewData["ContactEN"] = contact.ContactEN;
                }

            }
            else
            {
                contact = _nguyenHiepService.GetInformation(false);
                if (contact != null)
                {
                    ViewData["ContactVN"] = contact.ContactVN;
                }
            }
            return View(contact);
        }
        public bool UpdateInformation(tblInformation infor)
        {
            if (infor != null && !infor.ID.Equals(Guid.Empty))
            {
                var query = _dataContext.tblInformations.Where("ID.ToString()=@0", infor.ID.ToString());
                if (query != null && query.ToList().Count > 0)
                {
                    if(!String.IsNullOrEmpty(infor.ContactVN))
                        query.ToList().First().ContactVN = infor.ContactVN;
                    if (!String.IsNullOrEmpty(infor.ContactEN))
                        query.ToList().First().ContactEN = infor.ContactEN;
                    try
                    {
                        _dataContext.SubmitChanges();
                        return true;
                    }
                    catch
                    {
                        return false;
                    }
                }

            }
            return false;
        }
 public bool InsertInformation(tblInformation infor)
 {
     if (infor != null && !infor.ID.Equals(Guid.Empty))
     {
         try
         {
             _dataContext.tblInformations.InsertOnSubmit(infor);
             _dataContext.SubmitChanges();
             return true;
         }
         catch
         {
             return false;
         }
     }
     return false;
 }