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

            if (ModelState.IsValid)
            {
                var matchuser = db.Customers.Where(a => a.Username.Equals(model.Username)).FirstOrDefault();
                if (matchuser == null)
                {
                    Customer customer = new Customer();
                    customer.CustomerId           = 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 = DateTime.Now;
                    customer.IsActive             = true;
                    customer.createddate          = DateTime.Now;
                    customer.updateddate          = DateTime.Now;

                    ViewBag.CustomerId    = customer.CustomerId;
                    ViewBag.StatusMessage = "SuccessAdd";


                    var          role         = RoleService.GetRoleByName("User");
                    CustomerRole customerrole = new CustomerRole();
                    if (role != null)
                    {
                        customerrole.RoleId     = role.RoleId;
                        customerrole.CustomerId = customer.CustomerId;
                    }
                    customer.CustomerRoles.Add(customerrole);
                    ManageCustomerService.InsertCustomer(customer);


                    //Transaction
                    Transaction transaction = new Transaction();
                    transaction.CustomerId      = customer.CustomerId;
                    transaction.Amount          = 100;
                    transaction.TransactionDate = DateTime.Now;
                    transaction.Status          = "completed";
                    transaction.TransactionType = "credit";
                    transaction.CreatedDate     = DateTime.Now;
                    transaction.UpdatedDate     = DateTime.Now;
                    transaction.PaymentMethod   = "offline";
                    TransactionService.InsertTransaction(transaction);
                }
                else
                {
                    ViewBag.Message = "  This user is already exists";
                    return(View());
                }
            }
            return(View(model));
        }