Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            int            sid  = Convert.ToInt32(txt_sid.Text);
            int            pino = Convert.ToInt32(cmb_pino.Text);
            int            qty  = Convert.ToInt32(ret_qty.Text);
            class_p_return p    = new class_p_return();
            int            flag = 0;

            p.add(sid, pino, qty, txt_res.Text);

            flag = p.update(qty, pino);
            if (flag > 0)
            {
                // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                popup.Image       = Properties.Resources.Information_Bubble_48;
                popup.ContentText = "Success";
                // popup.BodyColor.ToString();
                popup.Popup();
            }
            else
            {
                MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            conDB.con.Open();
            int            id  = Convert.ToInt32(txt_sid.Text);
            SqlDataAdapter dap = new SqlDataAdapter("SELECT * FROM tbl_rt where pino='" + pino + "' ", conDB.con);
            DataTable      dt  = new DataTable();

            dap.Fill(dt);
            metroGrid1.DataSource = dt;
            metroGrid1.Refresh();

            conDB.con.Close();
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            int ff = 0;

            if (p.Text == cp.Text)
            {
                class_user h = new class_user();
                ff = h.updt_pwd(u.Text, p.Text);
                if (ff > 0)
                {
                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                    popup.Image       = Properties.Resources.Information_Bubble_48;
                    popup.ContentText = "Success";
                    // popup.BodyColor.ToString();
                    popup.Popup();
                }
                else
                {
                    MessageBox.Show("Error ", "Error Window", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Both Password Should be same ", "Error Window", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            // string type = comboBox1.SelectedIndex.ToString();
            string un  = txt_un.Text;
            string pwd = txt_pwd.Text;
            string cnf = txt_cpwd.Text;

            if (txt_un.Text.Length > 0)
            {
                errorProvider3.Clear();
                if (txt_pwd.Text.Length > 0)
                {
                    errorProvider1.Clear();
                    if (txt_cpwd.Text.Length > 0)
                    {
                        errorProvider1.Clear();
                    }
                    else
                    {
                        errorProvider1.SetError(txt_un, "Required");
                    }
                }
                else
                {
                    errorProvider1.SetError(txt_cpwd, "Requierd");
                }
            }
            else
            {
                errorProvider3.SetError(txt_un, "Requierd");
            }
            int flag = 0;

            if (pwd == cnf)
            {
                errorProvider1.Clear();
                class_user u = new class_user();

                flag = u.add(un, pwd);
            }
            else
            {
                errorProvider1.SetError(txt_pwd, "Password not matching");
            }


            if (flag > 0)
            {
                // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                popup.Image       = Properties.Resources.Information_Bubble_48;
                popup.ContentText = "Success";
                // popup.BodyColor.ToString();
                popup.Popup();
            }
            else
            {
                MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
        private void button9_Click(object sender, EventArgs e)
        {
            try
            {
                int            flag = 0;
                int            id   = Convert.ToInt32(txt_sid.Text);
                class_supplier cs   = new class_supplier();
                flag = cs.delete(id);

                if (flag > 0)
                {
                    // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                    popup.Image       = Properties.Resources.Information_Bubble_48;
                    popup.ContentText = "Success";
                    // popup.BodyColor.ToString();
                    popup.Popup();
                }
                else
                {
                    MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                setDataGride2();
            }
            catch (Exception)
            {
                MessageBox.Show("Error");
            }
            toClearTextField_sup();
        }
Esempio n. 5
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                int            flag = 0;
                int            id   = Convert.ToInt32(txt_cid.Text);
                int            mno  = Convert.ToInt32(txt_cmno.Text);
                class_customer ss   = new class_customer();
                flag = ss.update(txt_cfnme.Text, txt_cmnme.Text, txt_clnme.Text, txt_add1.Text, txt_add2.Text, txt_add3.Text, mno, txt_cemail.Text, id);

                if (flag > 0)
                {
                    // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                    popup.Image       = Properties.Resources.Information_Bubble_48;
                    popup.ContentText = "Success";
                    // popup.BodyColor.ToString();
                    popup.Popup();
                }
                else
                {
                    MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error");
            }
            toClearText();
        }
Esempio n. 6
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (txt_siz.Text.Length > 0)
     {
         errorProvider1.Clear();
         if (txt_clr.Text.Length > 0)
         {
             errorProvider3.Clear();
             if (txt_cat.Text.Length > 0)
             {
                 errorProvider1.Clear();
                 if (txt_mat.Text.Length > 0)
                 {
                     errorProvider1.Clear();
                     class_user u    = new class_user();
                     int        flag = 0;
                     flag = u.add(txt_cat.Text, txt_mat.Text, txt_clr.Text, txt_siz.Text);
                     setDataGride2();
                     clear();
                     if (flag > 0)
                     {
                         // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                         popup.Image       = Properties.Resources.Information_Bubble_48;
                         popup.ContentText = "Success";
                         // popup.BodyColor.ToString();
                         popup.Popup();
                     }
                     else
                     {
                         MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
                 else
                 {
                     errorProvider1.SetError(txt_mat, "Required");
                 }
             }
             else
             {
                 errorProvider1.SetError(txt_cat, "Requierd");
             }
         }
         else
         {
             errorProvider3.SetError(txt_clr, "Requierd");
         }
     }
     else
     {
         errorProvider1.SetError(txt_siz, "Required");
     }
 }
        /// <summary>
        /// Create a new instance.
        /// </summary>
        /// <param name="parent">PopupNotifier</param>
        public PopupNotifierForm(PopupNotifier parent)
        {
            Parent = parent;
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.ShowInTaskbar = false;

            this.VisibleChanged += new EventHandler(PopupNotifierForm_VisibleChanged);
            this.MouseMove      += new MouseEventHandler(PopupNotifierForm_MouseMove);
            this.MouseUp        += new MouseEventHandler(PopupNotifierForm_MouseUp);
            this.Paint          += new PaintEventHandler(PopupNotifierForm_Paint);
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            //int pid = Convert.ToInt32(txt_pid.Text);
            // DateTime dt = DateTime.Today;
            int    sid   = Convert.ToInt32(cmb_sid.Text);
            int    qty   = Convert.ToInt32(txt_Qty.Text);
            double up    = Convert.ToDouble(txt_UP.Text);
            String iname = txt_iname.Text;
            String des   = txt_Descrip.Text;
            //txt_Date.Text=dt.ToString();

            Class_purchase a = new Class_purchase();

            a.add(iname, qty, des, up, txt_Date.Text);
            conDB.con.Open();

            string        qury = "SELECT max(pino) from tbl_purchase_item";
            SqlCommand    cmd  = new SqlCommand(qury, conDB.con);
            SqlDataReader dr   = cmd.ExecuteReader();
            int           pino = 0;

            while (dr.Read())
            {
                // txt_oid.Text = dr.GetValue(0).ToString();
                pino = dr.GetInt32(0);
            }
            cmd.Dispose();
            dr.Dispose();
            cmd.Dispose();
            conDB.con.Close();
            int flag = 0;

            flag = a.add(sid, pino, qty, txt_Date.Text);

            if (flag > 0)
            {
                // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                popup.Image       = Properties.Resources.Information_Bubble_48;
                popup.ContentText = "Success";
                // popup.BodyColor.ToString();
                popup.Popup();
            }
            else
            {
                MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            lddata();
        }
Esempio n. 9
0
        private void button4_Click(object sender, EventArgs e)
        {
            int        id   = Convert.ToInt32(txt_ino.Text);
            int        flag = 0;
            class_user u    = new class_user();

            flag = u.delete(id);
            setDataGride2();
            if (flag > 0)
            {
                // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                popup.Image       = Properties.Resources.Information_Bubble_48;
                popup.ContentText = "Success";
                // popup.BodyColor.ToString();
                popup.Popup();
            }
            else
            {
                MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 10
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            try
            {
                int    flag = 0;
                int    cid  = Convert.ToInt32(txt_icid.Text);
                int    oid  = Convert.ToInt32(cmb_ioid.SelectedIndex.ToString());
                string dt   = txt_date.Text;
                double st   = Convert.ToDouble(txt_nt.Text);

                class_invoice inv = new class_invoice();
                flag = inv.add(cid, oid, dt, st);
                if (flag > 0)
                {
                    // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                    popup.Image       = Properties.Resources.Information_Bubble_48;
                    popup.ContentText = "Success";
                    // popup.BodyColor.ToString();
                    popup.Popup();
                }
                else
                {
                    MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (SqlException)
            {
                MessageBox.Show(this, "Database Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            catch (Exception)
            {
                MessageBox.Show(this, "Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 11
0
        private void button3_Click(object sender, EventArgs e)
        {
            // try
            //  {
            conDB.con.Open();
            int oid = Convert.ToInt32(txt_roid.Text);
            int pid = Convert.ToInt32(cmb_rpid.SelectedIndex.ToString());
            int cid = Convert.ToInt32(txt_rcid.Text);

            int           qty  = Convert.ToInt32(txt_rqty.Text);
            string        q    = "select fqty from tbl_finish_output where f_ID = '" + pid + "'  ";
            SqlCommand    cd   = new SqlCommand(q, conDB.con);
            SqlDataReader drr  = cd.ExecuteReader();
            int           qtyo = 0;

            while (drr.Read())
            {
                // qtyo = Convert.ToInt32(drr.GetValue(0).ToString());
                qtyo = drr.GetInt32(0);
            }
            //  txt_rcid.Text = cid.ToString();
            cd.Dispose();
            drr.Dispose();

            conDB.con.Close();
            if (qty > qtyo)
            {
                MessageBox.Show("Invalid", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int flag = 0;


                class_s_return s = new class_s_return();

                flag = s.add(cid, oid, pid, qty, txt_reson.Text);
                if (flag > 0)
                {
                    // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                    popup.Image       = Properties.Resources.Information_Bubble_48;
                    popup.ContentText = "Success";
                    // popup.BodyColor.ToString();
                    popup.Popup();
                }
                else
                {
                    MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                conDB.con.Open();
                //int oid = Convert.ToInt32(txt_oid.Text);
                SqlDataAdapter dap = new SqlDataAdapter("SELECT * FROM tbl_cus_rt where cus_ID='" + cid + "' ", conDB.con);
                DataTable      dt  = new DataTable();
                dap.Fill(dt);
                metroGrid3.DataSource = dt;
                metroGrid3.Refresh();

                conDB.con.Close();
            }

            /*  }
             * catch (Exception)
             * {
             * }*/
        }
Esempio n. 12
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmb_oid.Text.Length > 0)
                {
                    errorProvider1.Clear();
                    if (txt_pnme.Text.Length > 0)
                    {
                        errorProvider3.Clear();
                        if (txt_qty.Text.Length > 0)
                        {
                            errorProvider2.Clear();
                            if (txt_fqty.Text.Length > 0)
                            {
                                errorProvider1.Clear();
                                int flag = 0;

                                DateTime dtnow = DateTime.Today;
                                int      qty   = 0;
                                int      ino   = Convert.ToInt32(txt_rino.Text);
                                int      tot   = Convert.ToInt16(txt_tot.Text);
                                int      oid   = Convert.ToInt32(cmb_oid.Text);
                                qty = Convert.ToInt32(txt_qty.Text);
                                int           fqty = Convert.ToInt32(txt_fqty.Text);
                                Class_product PP   = new Class_product();
                                flag = PP.add(oid, tot, txt_pnme.Text, fqty);
                                // cmd = new SqlCommand();
                                conDB.con.Open();
                                int fid = 0;

                                cmd.Connection  = conDB.con;
                                cmd.CommandText = "SELECT max(f_ID) FROM tbl_finish_output ";
                                SqlDataReader dr;

                                dr = cmd.ExecuteReader();

                                while (dr.Read())
                                {
                                    fid = Convert.ToInt32(dr.GetValue(0).ToString());
                                }

                                dr.Close();

                                cmd.Dispose();
                                conDB.con.Close();
                                PP.update(qty, ino);
                                PP.add(ino, fid, qty);

                                if (flag > 0)
                                {
                                    // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                                    popup.Image       = Properties.Resources.Information_Bubble_48;
                                    popup.ContentText = "Success";
                                    // popup.BodyColor.ToString();
                                    popup.Popup();
                                }
                                else
                                {
                                    MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                }
                            }
                            else
                            {
                                errorProvider1.SetError(txt_fqty, "Enter quantity");
                            }
                        }
                        else
                        {
                            errorProvider3.SetError(txt_qty, "Quantity Required");
                        }
                    }
                    else
                    {
                        errorProvider2.SetError(txt_pnme, "Please enter design no");
                    }
                }
                else
                {
                    errorProvider1.SetError(cmb_oid, "Please select customer");
                }
            }
            catch (SqlException)
            {
                MessageBox.Show(this, "Database Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            catch (Exception)
            {
                MessageBox.Show(this, "Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 13
0
        private void btn_srch_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmb_fnme.Text.Length > 0)
                {
                    errorProvider1.Clear();
                    if (txt_dsno.Text.Length > 0)
                    {
                        if (txt_qty.Text.Length > 0)
                        {
                            errorProvider2.Clear();
                            int flag = 0;

                            DateTime dtnow = DateTime.Today;
                            int      qty   = 0;
                            int      ino   = Convert.ToInt16(txt_ino.Text);
                            int      oid   = Convert.ToInt32(txt_oid.Text);
                            qty = Convert.ToInt32(txt_qty.Text);

                            Class_sales cs = new Class_sales();

                            flag = cs.add(ino, oid, qty, txt_dsno.Text);


                            if (flag > 0)
                            {
                                // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                                popup.Image       = Properties.Resources.Information_Bubble_48;
                                popup.ContentText = "Success";
                                // popup.BodyColor.ToString();
                                popup.Popup();
                            }
                            else
                            {
                                MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                            clear();
                        }
                        else
                        {
                            errorProvider3.SetError(txt_qty, "Quantity Required");
                        }
                    }
                    else
                    {
                        errorProvider2.SetError(txt_dsno, "Please enter design no");
                    }
                }
                else
                {
                    errorProvider1.SetError(cmb_fnme, "Please select customer");
                }



                loadmetro2();

                //  load();
            }
            catch (SqlException)
            {
                MessageBox.Show(this, "Database Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            catch (Exception)
            {
                MessageBox.Show(this, "Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 14
0
        private void button7_Click(object sender, EventArgs e)
        {
            try
            {
                if (txt_sfnme.Text.Length > 0)
                {
                    errorProvider1.Clear();

                    errorProvider3.Clear();
                    if (txt_sadd1.Text.Length > 0)
                    {
                        errorProvider4.Clear();
                        if (txt_sadd2.Text.Length > 0)
                        {
                            errorProvider5.Clear();
                            if (txt_sadd3.Text.Length > 0)
                            {
                                errorProvider6.Clear();
                                if (txt_smno.Text.Length != 0)
                                {
                                    errorProvider7.Clear();
                                    if (txt_semail.Text.Length > 0)
                                    {
                                        errorProvider8.Clear();
                                        if (txt_c_nme.Text.Length > 0)
                                        {
                                            errorProvider2.Clear();
                                        }
                                        else
                                        {
                                            errorProvider2.SetError(txt_c_nme, "You should fiil  required data");
                                        }
                                    }
                                    else
                                    {
                                        errorProvider8.SetError(txt_semail, "You should fiil  required data");
                                    }
                                }
                                else
                                {
                                    errorProvider7.SetError(txt_smno, "You should fiil  required data");
                                }
                            }
                            else
                            {
                                errorProvider6.SetError(txt_sadd3, "You should fiil  required data");
                            }
                        }
                        else
                        {
                            errorProvider5.SetError(txt_sadd2, "You should fiil  required data");
                        }
                    }
                    else
                    {
                        errorProvider4.SetError(txt_sadd1, "You should fiil  required data");
                    }
                }
                else
                {
                    errorProvider1.SetError(txt_sfnme, "You should fiil  required data");
                }

                int flag = 0;
                int mno  = Convert.ToInt32(txt_smno.Text);

                class_supplier ss = new class_supplier();

                flag = ss.add(txt_sfnme.Text, txt_sadd1.Text, txt_sadd2.Text, txt_sadd3.Text, mno, txt_semail.Text, txt_c_nme.Text);


                if (flag > 0)
                {
                    // MessageBox.Show(this, "Row added", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    PopupNotifier popup = new Tulpep.NotificationWindow.PopupNotifier();
                    popup.Image       = Properties.Resources.Information_Bubble_48;
                    popup.ContentText = "Success";
                    // popup.BodyColor.ToString();
                    popup.Popup();
                }
                else
                {
                    MessageBox.Show(this, "Data not added ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                setDataGride2();
            }
            catch (Exception)
            {
            }
            toClearTextField_sup();
        }