public ActionResult Edit(CustomerModel model)
        {
            if (Session["CustomerId"] == null)
            {
                return(RedirectToAction("Login", "Home"));
            }

            Customer customer = ManageCustomerService.GetCustomerById(model.CustomerId);

            customer.FirstName            = model.FirstName;
            customer.LastName             = model.LastName;
            customer.Email                = model.Email;
            customer.Contactno            = model.Contactno;
            customer.Username             = model.Username;
            customer.Password             = model.Password;
            customer.CompanyName          = model.CompanyName;
            customer.Date_of_Registration = model.Date_of_Registration;

            customer.CustomerId = model.CustomerId;
            customer.IsActive   = model.AccountStatus;
            //customer.createddate = DateTime.Now;
            //customer.updateddate = DateTime.Now;
            ManageCustomerService.UpdateCustomer(customer);

            ViewBag.StatusMessage = "SuccessUpdate";
            return(View(model));
        }
        public ActionResult Edit(int CustomerId = 0)
        {
            if (Session["CustomerId"] == null)
            {
                return(RedirectToAction("Login", "Home"));
            }
            Customer customer = ManageCustomerService.GetCustomerById(CustomerId);

            if (customer == null)
            {
                return(HttpNotFound());
            }

            CustomerModel model = new CustomerModel();

            model.CustomerId           = customer.CustomerId;
            model.FirstName            = customer.FirstName;
            model.LastName             = customer.LastName;
            model.Email                = customer.Email;
            model.Contactno            = customer.Contactno;
            model.Username             = customer.Username;
            model.Password             = customer.Password;
            model.CompanyName          = customer.CompanyName;
            model.Date_of_Registration = customer.Date_of_Registration;

            model.IsActive      = customer.IsActive;
            model.AccountStatus = customer.IsActive;


            ViewBag.CustomerId = model.CustomerId;
            return(View(model));
        }
        public ActionResult ChangePassword(int CustomerId, string Password)
        {
            var rsult = "";

            try
            {
                Customer customer = ManageCustomerService.GetCustomerById(CustomerId);

                customer.Password = Password;
                ManageCustomerService.UpdateCustomer(customer);
                rsult = "Password Saved Successfully";
            }
            catch
            {
                rsult = "Try again";
            }


            return(Json(rsult));
        }