Ejemplo n.º 1
0
        void ICarDealershipRepository.ContactUs(ContactUs contactInfo)
        {
            ContactUs newContact = new ContactUs();

            newContact.ContactUsId = ContactUs.Max(id => id.ContactUsId) + 1;
            newContact.Name        = contactInfo.Name;
            newContact.Phone       = contactInfo.Phone;
            newContact.Email       = contactInfo.Email;
            newContact.Message     = contactInfo.Message;

            ContactUs.Add(newContact);
        }
Ejemplo n.º 2
0
 public ActionResult Index(string name, string subject, string email, string message)
 {
     ViewBag.Title   = TokenShop.Common.LanguageManagment.Translate("contact_us");
     ViewBag.message = "";
     try
     {
         if (string.IsNullOrEmpty(message))
         {
             ViewBag.message = "لطفا متن پیام مورد نظر خود را وارد نمایید";
         }
         if (string.IsNullOrEmpty(subject))
         {
             ViewBag.message = "لطفا موضوع مورد نظر را وارد نمایید";
         }
         if (string.IsNullOrEmpty(email))
         {
             ViewBag.message = "لطفا ایمیل خود را وارد نمایید";
         }
         if (string.IsNullOrEmpty(name))
         {
             ViewBag.message = "لطفا نام خود را وارد نمایید";
         }
         if (string.IsNullOrEmpty(ViewBag.message))
         {
             ContactUs cont = new ContactUs();
             cont.Date    = DateTime.Now;
             cont.Email   = email;
             cont.Ip      = "";
             cont.Message = message;
             cont.Name    = name;
             cont.Read    = false;
             cont.Subject = subject;
             cont.Add();
         }
     }
     catch (Exception ex)
     {
         ViewBag.message = "خطای سیستم رخ داده است.لطفا مجدد تلاش نمایید";
         ErrorLog err = new ErrorLog();
         err.Description = ex.Message;
         if (ex.InnerException != null)
         {
             err.Description += ";" + ex.InnerException.Message;
         }
         err.Add();
     }
     return(View());
 }
Ejemplo n.º 3
0
 public ActionResult Add(ContactUs b)
 {
     b.Add();
     return(View());
 }