Beispiel #1
0
        public string ContactUs(FontContact contact)
        {
            string status = string.Empty;

            try
            {
                using (SqlConnection con = ConnectionHelper.getConnection())
                {
                    //DataSet ds = new DataSet();
                    SqlCommand cmd = new SqlCommand("FontContactInsert", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@CustomerName", contact.CustomerName);
                    cmd.Parameters.AddWithValue("@CustomerMobile", contact.CustomerMobile);
                    cmd.Parameters.AddWithValue("@CustomerMessage", contact.CustomerMessage);
                    cmd.Parameters.AddWithValue("@CustomerEmail", contact.CustomerEmail);
                    cmd.Parameters.AddWithValue("@createddate", DateTime.UtcNow);
                    cmd.Parameters.AddWithValue("@modifieddate", DateTime.UtcNow);
                    cmd.Parameters.AddWithValue("@isactive", 1);
                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();
                    //ds = SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "FontContactInsert");

                    status = "Success";
                }
            }
            catch (Exception ex)
            {
                status = ex.Message;
            }
            return(status);
        }
Beispiel #2
0
 public ActionResult SubmitContact(FontContact contact)
 {
     try
     {
         service.ContactUs(contact);
         return(View("View_Contact"));
     }
     catch
     {
         return(View("View_Contact"));
     }
 }