예제 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (textGroupName.Text != "")
            {
                if (textDescription.Text != "")
                {
                    GroupBLL = GroupDAL.checkGroupAvailableOrNot(textGroupName.Text);

                    if (textGroupName.Text != GroupBLL.Group_Name)
                    {
                        GroupBLL.Group_Name  = textGroupName.Text;
                        GroupBLL.Description = textDescription.Text;

                        bool success = GroupDAL.Insert(GroupBLL);
                        if (success == true)
                        {
                            MessageBox.Show("Categoriy Inserted Succesfully .!!");
                            clear();
                            DataTable dt = GroupDAL.Select();
                            dgvGroup.DataSource = dt;
                        }
                        else
                        {
                            MessageBox.Show("Failed to insert category :/ ");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Group is Already Added in Database Please choose another Group");
                    }
                }
                else
                {
                    MessageBox.Show("Please enter Description");
                }
            }
            else
            {
                MessageBox.Show("Please enter Group Name");
            }
        }
        private void frmProductMaster_Load(object sender, EventArgs e)
        {
            DataTable dt = pDAL.Select();

            dgvProductMaster.DataSource = dt;

            DataTable dtg = gDAL.Select();

            comboProduct_Group.DisplayMember = "Group_Name";
            comboProduct_Group.DataSource    = dtg;

            DataTable dtb = bDAL.Select();

            comboBrand.DisplayMember = "Brand_Name";
            comboBrand.DataSource    = dtb;
        }
예제 #3
0
        private void frmStockReport_Load(object sender, EventArgs e)
        {
            btnDate.Text = DateTime.Now.ToString();
            DataTable dt = stockDAL.SelectAllProductStock();

            dgvStockReport.DataSource = dt;

            DataTable dtp = pDAL.Select();

            comboProduct.DisplayMember = "Product_Name";
            comboProduct.DataSource    = dtp;

            DataTable dtg = gDAL.Select();

            comboGroup.DisplayMember = "Group_Name";
            comboGroup.DataSource    = dtg;

            DataTable dtb = bDAL.Select();

            comboBrand.DisplayMember = "Brand_Name";
            comboBrand.DataSource    = dtb;
        }