Esempio n. 1
0
        private void frmBirthRegistration_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'comDataSet.usp_SEL_Birth' table. You can move, or remove it, as needed.
            this.usp_SEL_BirthTableAdapter.Fill(this.comDataSet.usp_SEL_Birth);
            if (DBLayer.User_Right(UserID, SecurityLevelID, "[Modify]"))
            {
                btnEdit.Enabled = true;
            }
            else
            {
                btnEdit.Enabled = false;
            }

            if (DBLayer.User_Right(UserID, SecurityLevelID, "[Delete]"))
            {
                btnDelete.Enabled = true;
            }
            else
            {
                btnDelete.Enabled = false;
            }

            if (DBLayer.User_Right(UserID, SecurityLevelID, "[Write]"))
            {
                btnNew.Enabled = true;
            }
            else
            {
                btnNew.Enabled = false;
            }
            AcceptButton = btnNew;
            dgvBirth.BringToFront();
        }
Esempio n. 2
0
        private void GenerateBill_Load(object sender, EventArgs e)
        {
            if (DBLayer.User_Right(UserID, SecurityLevelID, "[Modify]"))
            {
                btnEdit.Enabled = true;
            }
            else
            {
                btnEdit.Enabled = false;
            }
            if (DBLayer.User_Right(UserID, SecurityLevelID, "[Write]"))
            {
                btnNew.Enabled = true;
            }
            else
            {
                btnNew.Enabled = false;
            }
            // TODO: This line of code loads data into the 'dataset2.tblEvents' table. You can move, or remove it, as needed.
            this.tblEventsTableAdapter.Fill(this.dataset2.tblEvents);
            // TODO: This line of code loads data into the 'dataset2.tblEvents' table. You can move, or remove it, as needed.
            this.tblEventsTableAdapter.Fill(this.dataset2.tblEvents);
            //this.AutoScrollPosition = new Point(1200,1200);
            //Generate transaction number
            GenerateTransactionId();

            //Fill Grid on Load
            FillDataGrid();

            //Load Group Box
            LoadBillerInformation();

            //Populate Items
            PopulateItemOptions();

            //Populate Search Criteria
            foreach (DataColumn dc in dtSearch.Columns)
            {
                cmbCriteria.Items.Add(dc.ToString());
            }
        }
Esempio n. 3
0
        private void btnFCardNo_Click(object sender, EventArgs e)
        {
            txtFCardNo_Leave(sender, e);
            string x = txtFCardNo.Text;

            Community.DBLayer dblayer = new Community.DBLayer();
            if (txtFCardNo.Text == "")
            {
                MessageBox.Show("Please Insert Family Card Number", "Family Card Required", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
            else
            {
                bool result = dblayer.CheckFamily(txtFCardNo.Text);
                if (result)
                {
                    usp_SEL_FAMILYTableAdapter.Leader(comDataSet.usp_SEL_FAMILY, txtFCardNo.Text);
                    //if (DGRenewal.Rows.Count == 0)
                    //{
                    //    btnEdit.Enabled = false;
                    //    btnPrint.Enabled = false;
                    //}
                    //else
                    //{
                    //    btnEdit.Enabled = false;
                    //    btnPrint.Enabled = false;
                    //}
                    if (txtFCardNo.Text == "")
                    {
                        txtFCardNo.Text = x;
                    }
                    btnViewInfo_Click(sender, e);


                    usp_SEL_tblFamilyMemberTableAdapter.FillActive(comDataSet.usp_SEL_tblFamilyMember, txtFCardNo.Text);
                    txtTotalMembers.Text = comDataSet.usp_SEL_tblFamilyMember.Rows.Count.ToString();

                    GetFemaleInformation(txtFCardNo.Text);

                    usp_Male_tblFamilyMemberTableAdapter.Fill(comDataSet.usp_Male_tblFamilyMember, txtFCardNo.Text, "Male");
                    int Male = DGInfo.Rows.Count;

                    CalculateAge();

                    usp_SEL_tblFamilyMemberTableAdapter.FillAdult(comDataSet.usp_SEL_tblFamilyMember, txtFCardNo.Text);
                    int Adults = comDataSet.usp_SEL_tblFamilyMember.Rows.Count;
                    txtAdult.Text = Adults.ToString();

                    int Minor = Male - Adults;
                    txtMinor.Text = Minor.ToString();
                    if (DBLayer.User_Right(UserID, SecurityLevelID, "[Modify]"))
                    {
                        btnEdit.Enabled = true;
                    }
                    else
                    {
                        btnEdit.Enabled = false;
                    }

                    if (DBLayer.User_Right(UserID, SecurityLevelID, "[Delete]"))
                    {
                        btnDelete.Enabled = true;
                    }
                    else
                    {
                        btnDelete.Enabled = false;
                    }

                    if (DBLayer.User_Right(UserID, SecurityLevelID, "[Write]"))
                    {
                        btnAdd.Enabled = true;
                    }
                    else
                    {
                        btnAdd.Enabled = false;
                    }
                    //Get Selected Family Card Renewal Info
                    usp_SEL_RenewalTableAdapter.Fill(comDataSet.usp_SEL_Renewal, txtFCardNo.Text);
                    btnViewInfo.Enabled = true;
                    this.AcceptButton   = btnAdd;
                    btnPrint.Enabled    = true;
                    //btnDelete.Enabled = true;
                    if (txtFCardNo.Text == "")
                    {
                        txtFCardNo.Text = x;
                    }
                    //if()
                }
                else
                {
                    MessageBox.Show("Family CardNo doesnot exist! Please enter a Valid CardNo.", "Invalid CardNo.", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    btnAdd.Enabled      = false;
                    btnEdit.Enabled     = false;
                    DGRenewal.Enabled   = false;
                    btnViewInfo.Enabled = false;
                    btnPrint.Enabled    = false;
                }
            }
        }