예제 #1
0
        private void btAddAuthor_Click(object sender, EventArgs e)
        {
            string AuthorName    = tbAuthorName.Text;
            string AuthorAddress = tbAuthorAddress.Text;
            string AuthorPhone   = tbAuthorPhone.Text;
            string AuthorEmail   = tbAuthorEmail.Text;
            string AuthorReg     = AuthorName + "" + AuthorPhone + "" + AuthorEmail;
            LMS    Register      = new LMS();
            int    val           = Register.InstertAuthor(AuthorReg, AuthorName, AuthorAddress, AuthorPhone, AuthorEmail);

            if (val == 1)
            {
                MessageBox.Show("New Author Added");
            }
        }
예제 #2
0
        private void btAddPublisher_Click(object sender, EventArgs e)
        {
            string PublisherName    = tbPublisherName.Text;
            string PublisherYear    = tbPublisherYear.Text;
            string PublisherHouse   = tbPublisherHouse.Text;
            string PublisherEdition = tbPublisherEdition.Text;
            string PublisherReg     = PublisherName + "" + PublisherYear + "" + PublisherEdition + "" + PublisherHouse;
            LMS    Register         = new LMS();
            int    val = Register.InsertPublisher(PublisherReg, PublisherName, PublisherYear, PublisherHouse, PublisherEdition);

            if (val == 1)
            {
                MessageBox.Show("New Publisher Added");
            }
        }
예제 #3
0
        private void btUpdatePublisher_Click(object sender, EventArgs e)
        {
            string Reg     = cbPublisherRegs.Text;
            string Name    = tbEditPublisherName.Text;
            string Year    = tbEditPublisherYear.Text;
            string House   = tbPublisherEditHouse.Text;
            string Edition = tbPublisherEditEdition.Text;

            LMS UpdatePublisher = new LMS();
            int val             = UpdatePublisher.UpdatePublisher(ID, Name, Year, House, Edition);

            if (val == 1)
            {
                MessageBox.Show("Data Updated");
            }
        }
예제 #4
0
        private void rbEditPublisher_CheckedChanged(object sender, EventArgs e)
        {
            if (rbEditPublisher.Checked == true)
            {
                cbPublisherRegs.Visible         = true;
                lblPublisheEditID.Visible       = true;
                lblPublisherEditEdition.Visible = true;
                lblPublisherEditHouse.Visible   = true;
                lblPublisherEdition.Visible     = false;
                lblPublisherEditName.Visible    = true;
                lblPublisherEditYear.Visible    = true;
                lblPublisherReg.Visible         = false;
                lblPublisherName.Visible        = false;
                lblPublisherYear.Visible        = false;
                lblPublishingHouse.Visible      = false;
                btUpdatePublisher.Visible       = true;
                btAddPublisher.Visible          = false;
                tbEditPublisherName.Visible     = true;
                tbEditPublisherYear.Visible     = true;
                tbPublisherEditEdition.Visible  = true;
                tbPublisherEditHouse.Visible    = true;
                tbPublisherEdition.Visible      = false;
                tbPublisherHouse.Visible        = false;
                tbPublisherReg.Visible          = false;
                tbPublisherName.Visible         = false;
                tbPublisherYear.Visible         = false;


                LMS       UpdatePublisher = new LMS();
                DataTable dt = UpdatePublisher.GettingPublisherTable();
                DGPublisher.DataSource = dt;
                if (DGPublisher.Rows.Count > 1)
                {
                    for (int i = 0; i < DGPublisher.Rows.Count; i++)
                    {
                        PublisherReg.Add(Convert.ToString(DGPublisher.Rows[i].Cells[1].Value));
                        PublisherName.Add(Convert.ToString(DGPublisher.Rows[i].Cells[2].Value));
                        PublisherYear.Add(Convert.ToString(DGPublisher.Rows[i].Cells[3].Value));
                        PublisherHouse.Add(Convert.ToString(DGPublisher.Rows[i].Cells[4].Value));
                        PublisherEdition.Add(Convert.ToString(DGPublisher.Rows[i].Cells[5].Value));
                        IDs.Add(Convert.ToInt32(DGPublisher.Rows[i].Cells[0].Value));
                        cbPublisherRegs.Items.Add(PublisherReg[i]);
                    }
                }
            }
        }
예제 #5
0
        private void rbEditAuthor_CheckedChanged(object sender, EventArgs e)
        {
            if (rbEditAuthor.Checked == true)
            {
                lblAuthorName.Visible        = false;
                lblAuthorReg.Visible         = false;
                lblAuthorAddress.Visible     = false;
                lblAuthorPhone.Visible       = false;
                lblAuthorEmail.Visible       = false;
                btAddAuthor.Visible          = false;
                tbAuthorEmail.Visible        = false;
                tbAuthorReg.Visible          = false;
                tbAuthorName.Visible         = false;
                tbAuthorAddress.Visible      = false;
                tbAuthorPhone.Visible        = false;
                lblAuthorEditAddress.Visible = true;
                lblAuthorEditEmail.Visible   = true;
                lblAuthorEditReg.Visible     = true;
                lblAuthorEditName.Visible    = true;
                lblAuthorEditPhone.Visible   = true;
                btUpdateAuthor.Visible       = true;
                tbEditAuthorAddress.Visible  = true;
                tbEditAuthorEmail.Visible    = true;
                tbEditAuthorName.Visible     = true;
                tbEditAuthorPhone.Visible    = true;
                cbAuthorRegs.Visible         = true;

                LMS       UpdateAuthor = new LMS();
                DataTable dt           = UpdateAuthor.GettingAuthorTable();
                DGAuthor.DataSource = dt;
                if (DGAuthor.Rows.Count > 1)
                {
                    for (int i = 0; i < DGAuthor.Rows.Count; i++)
                    {
                        AuthorReg.Add(Convert.ToString(DGAuthor.Rows[i].Cells[1].Value));
                        AuthorName.Add(Convert.ToString(DGAuthor.Rows[i].Cells[2].Value));
                        AuthorAddress.Add(Convert.ToString(DGAuthor.Rows[i].Cells[3].Value));
                        AuthorPhone.Add(Convert.ToString(DGAuthor.Rows[i].Cells[4].Value));
                        AuthorEmail.Add(Convert.ToString(DGAuthor.Rows[i].Cells[5].Value));
                        IDs.Add(Convert.ToInt32(DGAuthor.Rows[i].Cells[0].Value));
                        cbAuthorRegs.Items.Add(AuthorReg[i]);
                    }
                }
            }
        }
예제 #6
0
        private void btSignup_Click(object sender, EventArgs e)
        {
            LMS    Main           = new LMS();
            string RegistrationID = tbRegisterID.Text;
            string UserName       = tbUserName.Text;
            string Password       = tbPassword.Text;
            string Name           = tbName.Text;
            string Phone          = tbPhone.Text;
            string Email          = tbEmail.Text;
            string Issued         = "No";
            string Gender         = Convert.ToString(cbGender.SelectedValue);
            int    val            = Main.InsertMember(RegistrationID, Name, UserName, Password, Email, Issued);

            if (val == 1)
            {
                MessageBox.Show("Data Added");
            }
        }
예제 #7
0
 private void tbLogin_Click(object sender, EventArgs e)
 {
     #region AdminSelectFromComboBox
     if (cbRoleSelect.SelectedIndex == 0)
     {
         btMemberSignUP.Visible = false;
         if (tbUserName.Text == "mawaat" || tbPassword.Text == "mawaat")
         {
             WelcomeAdmin WelcomForm = new WelcomeAdmin();
             this.Hide();
             WelcomForm.Show();
         }
     }
     #endregion
     #region MemberSelectedFromComboxBox
     if (cbRoleSelect.SelectedIndex == 1)
     {
         WelcomeMember MemberPage = new WelcomeMember();
         btMemberSignUP.Visible = true;
         string        Username      = tbUserName.Text;
         string        Password      = tbPassword.Text;
         List <string> LoginUserName = new List <string>();
         List <string> LoginPassword = new List <string>();
         LMS           Login         = new LMS();
         DataTable     dt            = Login.GettingMemberTable();
         dgUserName.DataSource = dt;
         if (dgUserName.Rows.Count > 1)
         {
             for (int i = 0; i < dgUserName.Rows.Count; i++)
             {
                 LoginUserName.Add(Convert.ToString(dgUserName.Rows[i].Cells[3].Value));
                 LoginPassword.Add(Convert.ToString(dgUserName.Rows[i].Cells[4].Value));
                 if (Username == LoginUserName[i] && Password == LoginPassword[i])
                 {
                     this.Hide();
                     MemberPage.Show();
                 }
             }
         }
     }
     #endregion
 }
예제 #8
0
        private void tbUserName_TextChanged(object sender, EventArgs e)
        {
            List <string> Usernames = new List <string>();
            string        UserName  = tbUserName.Text;
            LMS           Main      = new LMS();
            DataTable     dt        = Main.GettingMemberTable();

            DGMember.DataSource = dt;
            if (DGMember.Rows.Count > 1)
            {
                for (int i = 0; i < DGMember.Rows.Count; i++)
                {
                    Usernames.Add(Convert.ToString(DGMember.Rows[i].Cells[3].Value));
                    if (UserName == Usernames[0])
                    {
                        MessageBox.Show("Username exist kindly change it");
                        tbUserName.Text = tbUserName.Text + "0";
                    }
                }
            }
        }
예제 #9
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //String s = "Select * From Profile_Master Where Pro_User_Id='" + textUserID.Text + "' and Pro_User_Password='******'";



            SqlDataAdapter sda = new SqlDataAdapter("Select * From Profile_Master Where Pro_User_Id='" + textUserID.Text + "' and Pro_User_Password='******'", con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);

            if (dt.Rows.Count == 1)
            {
                LMS obj = new LMS();
                obj.Show();
                this.Hide();
                con.Close();
            }
            else
            {
                MessageBox.Show("Invalid UserID or Password...", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }