예제 #1
0
        private void btnRegistration_Click(object sender, EventArgs e)
        {
            //add customer id and product id attributes to the registration object and pass that to the BLL

            RegistrationBLL regBLL           = new RegistrationBLL();
            Registration    registration     = new Registration();
            int             selectedCustomer = (int)cboCustomerName.SelectedValue;
            string          selectedProduct  = (string)cboProductName.SelectedValue;

            registration.CustomerID       = selectedCustomer;
            registration.ProductCode      = selectedProduct;
            registration.RegistrationDate = (DateTime)DateTime.Today;

            bool addRegistration = regBLL.AddNewRegistration(registration); //returns true or false depending on weather the registration was successful or not

            if (addRegistration == true)                                    //record insertion successful!
            {
                //CHANGE THESE MESSAGE BOX CONSTRUCTORS
                MessageBox.Show("The Product was successfully registered", "Add Registration", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("The registration already exists", "Add Registration", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
예제 #2
0
 protected void btnDelete_Command(object sender, CommandEventArgs e)
 {
     try
     {
         string id = Convert.ToString(e.CommandArgument);
         if (!string.IsNullOrEmpty(id))
         {
             RegistrationBLL registrationBLL = new RegistrationBLL();
             Registrations   registration    = new Registrations();
             registration.RegistrationId = Convert.ToInt32(QuaintSecurityManager.Decrypt(id));
             if (registration.RegistrationId > 0)
             {
                 if (registrationBLL.Delete(registration))
                 {
                     Alert(AlertType.Success, "Deleted successfully.");
                     LoadList();
                 }
                 else
                 {
                     Alert(AlertType.Error, "Failed to delete.");
                 }
             }
         }
     }
     catch (Exception)
     {
         Alert(AlertType.Error, "Failed to delete.");
     }
 }
예제 #3
0
 protected void btnActiveOrDeactive_Command(object sender, CommandEventArgs e)
 {
     try
     {
         string id = Convert.ToString(e.CommandArgument);
         if (!string.IsNullOrEmpty(id))
         {
             RegistrationBLL registrationBLL = new RegistrationBLL();
             DataTable       dt = registrationBLL.GetById(Convert.ToInt32(QuaintSecurityManager.Decrypt(id)));
             if (dt != null)
             {
                 if (dt.Rows.Count > 0)
                 {
                     Registrations registration = new Registrations();
                     registration.RegistrationId   = Convert.ToInt32(Convert.ToString(dt.Rows[0]["RegistrationId"]));
                     registration.RegistrationCode = Convert.ToString(dt.Rows[0]["RegistrationCode"]);
                     registration.FullName         = Convert.ToString(dt.Rows[0]["FullName"]);
                     registration.Email            = Convert.ToString(dt.Rows[0]["Email"]);
                     registration.ContactNumber    = Convert.ToString(dt.Rows[0]["ContactNumber"]);
                     registration.Address          = Convert.ToString(dt.Rows[0]["Address"]);
                     registration.EventId          = Convert.ToInt32(dt.Rows[0]["EventId"]);
                 }
             }
         }
     }
     catch (Exception)
     {
         Alert(AlertType.Error, "Failed to process.");
     }
 }
예제 #4
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtName.Text))
                {
                    Alert(AlertType.Warning, "Enter full name.");
                    txtName.Focus();
                }
                else if (string.IsNullOrEmpty(txtContactNumber.Text))
                {
                    Alert(AlertType.Warning, "Enter email.");
                    txtContactNumber.Focus();
                }
                else if (string.IsNullOrEmpty(txtAddress.Text))
                {
                    Alert(AlertType.Warning, "Enter password.");
                    txtAddress.Focus();
                }
                else
                {
                    Alert(AlertType.Information, "Please, wait...");
                    QuaintLibraryManager lib = new QuaintLibraryManager();
                    string fullName          = Convert.ToString(txtName.Text);
                    string email             = Convert.ToString(txtEmail.Text);
                    string contactNumber     = Convert.ToString(txtContactNumber.Text);
                    string address           = Convert.ToString(txtAddress.Text);

                    RegistrationBLL registrationBLL = new RegistrationBLL();
                    if (this.ModelId > 0)
                    {
                        Registrations registration = new Registrations();
                        registration.RegistrationCode = this.ModelCode;
                        registration.FullName         = fullName;
                        registration.Email            = email;
                        registration.ContactNumber    = contactNumber;
                        registration.Address          = address;
                        registration.EventId          = this.ModelId;

                        if (registrationBLL.Save(registration))
                        {
                            Alert(AlertType.Success, "Registration successful.");
                            ClearFileds();
                            GenerateCode();
                        }
                        else
                        {
                            Alert(AlertType.Error, "Failed to registration.");
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                Alert(AlertType.Error, ex.Message.ToString());
            }
        }
        public void Remove_Registration_Function()
        {
            RegistrationBLL RegistrationBLL = new RegistrationBLL();

            User_RegNo = Convert.ToInt32(lblRegNO.Text);
            RegistrationBLL.DeleteRegistration(User_RegNo);
            NUser_RegNo = 0;
            MessageBox.Show("\t\tData Successfully Removed\t\t", "Message");
        }
 public string resendOTP(string mobileNo)
 {
     try
     {
         RegistrationBLL registrationBll = new RegistrationBLL();
         return(registrationBll.resendOtp(mobileNo));
     }
     catch
     {
         return("0");
     }
 }
 public string checkOTP(string mobileNo, string otp)
 {
     try
     {
         RegistrationBLL registrationBll = new RegistrationBLL();
         return(registrationBll.checkOtp(mobileNo, otp));
     }
     catch
     {
         return("0");
     }
 }
 public string newRegistration(string registrationString)
 {
     try
     {
         RegistrationBLL registrationBll = new RegistrationBLL();
         return(registrationBll.NewRegistration(registrationString));
     }
     catch
     {
         return("0");
     }
 }
        public void Search_Registration_Function()
        {
            RegistrationBLL RegistrationBLL = new RegistrationBLL();

            RegistrationBLL.User_SerachRegistration(NUser_RegNo, LogInBLL.Sys_Id_Of_Admin);
            lblRegNO.Text  = RegistrationBLL.Ur_RegNoS.ToString();
            txtName.Text   = RegistrationBLL.Ur_NameS;
            txtDeprt.Text  = RegistrationBLL.Ur_DepartmentS;
            txtMobile.Text = RegistrationBLL.Ur_PhoneS;
            cmbYear.Text   = RegistrationBLL.Ur_YearS;
            User_Date      = RegistrationBLL.Ur_DateS;
        }
 public int newProfile(string profileString, string photo)
 {
     try
     {
         RegistrationBLL registrationBll = new RegistrationBLL();
         return(registrationBll.newProfile(profileString, photo));
     }
     catch
     {
         return(0);
     }
 }
예제 #11
0
 private void LoadList()
 {
     try
     {
         RegistrationBLL registrationBLL = new RegistrationBLL();
         DataTable       dt = registrationBLL.GetAll();
         rptrList.DataSource = dt;
         rptrList.DataBind();
     }
     catch (Exception)
     {
         //throw;
     }
 }
        public void Insert_Registration_Function()
        {
            RegistrationBLL RegistrationBLL = new RegistrationBLL();

            RegistrationBLL.Ur_RegNo      = User_RegNo;
            RegistrationBLL.Ur_Name       = User_Name;
            RegistrationBLL.Ur_Department = User_department;
            RegistrationBLL.Ur_Phone      = User_Phone;
            RegistrationBLL.Ur_Year       = User_Year;
            RegistrationBLL.Ur_Date       = DateTime.Now.ToString();
            RegistrationBLL.System_ID     = System_Id;
            RegistrationBLL.InsertRegistration(RegistrationBLL);
            MessageBox.Show("\t\tData Successfully Saved\t\t", "Message");
        }
예제 #13
0
        private void btnRegistration_Click(object sender, EventArgs e)
        {
            Registration    aRegistration = new Registration();
            RegistrationBLL regBLL        = new RegistrationBLL();

            aRegistration.CustomerID       = int.Parse(cboName.SelectedValue.ToString());
            aRegistration.ProductCode      = cboProduct.SelectedValue.ToString();
            aRegistration.RegistrationDate = (DateTime)DateTime.Today;
            if (regBLL.AddNewRegistration(aRegistration) == true)
            {
                MessageBox.Show("The product was successfuly registered.", "Add Registration", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("The registration already exists.", "Add Registration", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #14
0
        public ActionResult Register(UserModel userModel)
        {
            if (ModelState.IsValid)
            {
                Mapper map = new Mapper();
                // Create the user object that will recieve the mapped object
                MotoPartsCommon.User user = new MotoPartsCommon.User();
                user = map.MapUser(userModel);

                // Create BLL object for registration process
                RegistrationBLL reg = new RegistrationBLL();
                User            u   = reg.Register(user);

                // After inserting user into database log the user in
                LoginModel  loginModel = new LoginModel();
                LoginBLL    login      = new LoginBLL();
                List <User> listUser   = login.Login(u);

                // If theres a user returned
                if (listUser.Count == 1)
                {
                    // Set properties from gathered match in Database to model (login model is used for the session var)
                    loginModel.UserID            = listUser[0].UserID;
                    loginModel.FirstName         = listUser[0].FirstName;
                    loginModel.LastName          = listUser[0].LastName;
                    loginModel.UserName          = listUser[0].UserName;
                    loginModel.Email             = listUser[0].Email;
                    loginModel.RoleIDFK          = listUser[0].RoleIDFK;
                    loginModel.Salt              = listUser[0].Salt;
                    loginModel.SavedDirtbikeIDFK = listUser[0].SavedDirtbikeIDFK;
                    loginModel.UserPassword      = listUser[0].UserPassword;

                    // Track users properties for session
                    Session["loginModel"] = loginModel;

                    return(RedirectToAction("Landing", "Home", loginModel));
                }
            }
            // if forum is not blank but not valid tell user the Username is already used
            if (userModel.FirstName != null && userModel.LastName != null && userModel.UserName != null && userModel.UserPassword != null && userModel.Email != null)
            {
                ViewBag.Message = "This username is already being used.";
            }
            return(View(userModel));
        }
예제 #15
0
 protected void LoginSubmitButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         string                connectionString = ConfigurationManager.ConnectionStrings["RideXpressConnectionString"].ToString();
         RegistrationBLL       bll   = new RegistrationBLL(connectionString);
         RegistrationViewModel login = bll.GetRegistrationByUsername(Username.Text);
         if (InputPassword.Text.Equals(login.Password))
         {
             FormsAuthentication.RedirectFromLoginPage(Username.Text, false);
             //Response.Redirect("~/Cars.aspx");
         }
         else
         {
             Username.Text         = string.Empty;
             InputPassword.Text    = string.Empty;
             InvalidLoginText.Text = "Invalid Username or Password";
             //Response.Redirect("~/Login.aspx");
         }
     }
 }
        private void LoadDashboardInfo()
        {
            try
            {
                //Total Guide
                GuideBLL guideBLL = new GuideBLL();
                DataTable dtGuide = guideBLL.GetAll();
                lblTotalGuide.Text = Convert.ToString(Convert.ToInt32(dtGuide.Rows.Count));

                //Total Event
                EventBLL eventBLL = new EventBLL();
                DataTable dtEvent = eventBLL.GetAll();
                lblTotalEvent.Text = Convert.ToString(Convert.ToInt32(dtEvent.Rows.Count));

                //Total Location
                LocationBLL locationBLL = new LocationBLL();
                DataTable dtLocation = locationBLL.GetAll();
                lblTotalLocation.Text = Convert.ToString(Convert.ToInt32(dtLocation.Rows.Count));

                //Total Hotel Reservation
                HotelReservationBLL hotelReservationBLL = new HotelReservationBLL();
                DataTable dtHotelReservation = hotelReservationBLL.GetAll();
                lblTotalHotelReservation.Text = Convert.ToString(Convert.ToInt32(dtHotelReservation.Rows.Count));

                //Total Registration
                RegistrationBLL registrationBLL = new RegistrationBLL();
                DataTable dtRegistration = registrationBLL.GetAll();
                lblTotalRegistration.Text = Convert.ToString(Convert.ToInt32(dtRegistration.Rows.Count));

                //Total Registration
                //SubscribeBLL subscribeBLL = new SubscribeBLL();
                //DataTable dtSubscribe = subscribeBLL.GetAll();
                //lblTotalSubscribe.Text = Convert.ToString(Convert.ToInt32(dtSubscribe.Rows.Count));
            }
            catch (Exception)
            {
                
                throw;
            }
        }
예제 #17
0
 private void GenerateCode()
 {
     try
     {
         QuaintLibraryManager lib = new QuaintLibraryManager();
         ModelCode = CodePrefix.Registration + "-" + lib.GetSixDigitNumber(1);
         RegistrationBLL registrationBLL = new RegistrationBLL();
         DataTable       dt = registrationBLL.GetAll();
         if (dt != null)
         {
             if (dt.Rows.Count > 0)
             {
                 string[] lastCode       = dt.Rows[dt.Rows.Count - 1]["RegistrationCode"].ToString().Split('-');
                 int      lastCodeNumber = Convert.ToInt32(lastCode[1]);
                 ModelCode = CodePrefix.Registration + "-" + lib.GetSixDigitNumber(lastCodeNumber + 1);
             }
         }
     }
     catch (Exception)
     {
         Alert(AlertType.Error, "Failed to load.");
     }
 }
예제 #18
0
 protected void RegisterSubmitButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         string                connectionString = ConfigurationManager.ConnectionStrings["RideXpressConnectionString"].ToString();
         RegistrationBLL       bll          = new RegistrationBLL(connectionString);
         RegistrationViewModel registration = new RegistrationViewModel();
         registration.Username              = Username.Text;
         registration.Email                 = Email.Text;
         registration.Password              = InputPassword.Text;
         registration.FirstName             = FirstName.Text;
         registration.LastName              = LastName.Text;
         registration.Address               = Address.Text;
         registration.City                  = City.Text;
         registration.State                 = State.Text;
         registration.ZipCode               = Convert.ToInt32(ZipCode.Text);
         registration.DriversLicense        = DriversLicense.Text;
         registration.BirthDate             = BirthDate.Text;
         registration.LicenseExpirationDate = LicenseExpirationDate.Text;
         registration.LicenseIssuedState    = LicenseIssuedState.Text;
         bll.AddRegistration(registration);
         Response.Redirect("~/Index.aspx");
     }
 }
예제 #19
0
        public void Registration(RegistrationRequest request)
        {
            var account = RegistrationBLL.Execute(request);

            SignIn(account.Item1, account.Item2, Role.User);
        }
 public NinjectRegistrations()
 {
     _registrationDAL = new RegistrationDAL();
     _registrationBLL = new RegistrationBLL();
 }