public ActionResult Login(LoginView Log, string returnUrl)
        {
            if(ModelState.IsValid)
            {
                fetchinset f = new fetchinset();
                f.UserEmail=Log.UserName;
                f.Pass=Log.Password;
                var result =  fetchinset.fetchPass(f);
                if (result.Tables[0].Rows.Count> 0)
                {
                  return  RedirectToAction("Contact","Home");
                  //  return RedirectToAction("Contact").
                }
                else
                {

                    //return RedirectToAction("Manage", new { Message = ManageMessageId.Error });
                    ModelState.AddModelError("", "Invalid username or password.");

                }

            }
            else
            {
                 ModelState.AddModelError("", "Invalid username or password.");

            }
            return View(Log);
        }
        public static DataSet fetchPass(fetchinset fet)
        {
            DBConnection db = new DBConnection();

            db.AddParameter("@Email", fet.UserEmail);
            db.AddParameter("@Pass", fet.Pass);
            return(db.ExecuteDataSet("UserLogin"));
            //if(o!=null)
            //{
            //    string x = o.ToString();

            //}

            //return 1;
        }
        public static int Insert(fetchinset f)
        {
            DBConnection db = new DBConnection();

            db.AddParameter("@Email", f.UserEmail);
            db.AddParameter("@Pass", f.Pass);
            db.AddParameter("@CNFpass", f.confmPass);
            int v = db.ExecuteNonQuery("CreatePro");

            if (v > 0)
            {
                return(1);
            }
            else
            {
                return(-1);
            }
        }
 public static int Insert(fetchinset f)
 {
     DBConnection db = new DBConnection();
         db.AddParameter("@Email",f.UserEmail);
         db.AddParameter("@Pass", f.Pass);
         db.AddParameter("@CNFpass", f.confmPass);
         int v = db.ExecuteNonQuery("CreatePro");
         if(v > 0)
         {
             return 1;
         }
         else
         {
             return -1;
         }
 }
        public static DataSet fetchPass(fetchinset fet)
        {
            DBConnection db = new DBConnection();
                db.AddParameter("@Email",fet.UserEmail);
                db.AddParameter("@Pass", fet.Pass);
                return db.ExecuteDataSet("UserLogin");
                //if(o!=null)
                //{
                //    string x = o.ToString();

                //}

                //return 1;
        }