Exemple #1
0
        public static void autoIncriment(Control t, string sqlQuery)
        {
            DBconnect conn = new DBconnect();

            conn.DBopen();
            conn.SqlQuery(sqlQuery);
            SqlDataReader re = conn.SelQryRedEx();

            try
            {
                re.Read();
                string value = re[0].ToString();
                if (value == "")
                {
                    t.Text = "PMT0001";
                }
                else
                {
                    string temp   = value.Substring(3, 4);
                    int    number = Convert.ToInt32(temp);
                    number++;
                    string result = number.ToString().PadLeft(4, '0');
                    t.Text = "PMT" + result.ToString();
                }
            }

            catch (Exception er)
            {
                MessageBox.Show(er.Message);
            }
            conn.DBclose();
        }
Exemple #2
0
        public viewOmaster(string oId, string bId, string oD, string rsd, string csd, string hs, string ov, string ts, string ar, string ci)
        {
            InitializeComponent();
            con = new DBconnect();

            loadCombo();
            setRadio(ts);

            id_txt.Text = oId;
            oDate.Text  = oD;
            rDate.Text  = rsd;
            cDate.Text  = csd;
            hs_txt.Text = hs;
            ov_txt.Text = ov;
            bc_cmb.Text = bId;
            ar_cmb.Text = ar;
            ci_cmb.Text = ci;


            bc_cmb.Tag  = 0;
            oDate.Tag   = 0;
            rDate.Tag   = 0;
            cDate.Tag   = 0;
            hs_txt.Tag  = 0;
            yes_rad.Tag = 0;
            no_rad.Tag  = 0;
            ci_cmb.Tag  = 0;
            ar_cmb.Tag  = 0;
            ov_txt.Tag  = 0;
        }
Exemple #3
0
 public addCli()
 {
     InitializeComponent();
     Design.curve(this);
     timer1.Start();
     con = new DBconnect();
 }
Exemple #4
0
 public FP(string samId, string ord, string buyCode)
 {
     InitializeComponent();
     conn = new DBconnect();
     loadPicture(samId);
     loadLabels(samId, ord, buyCode);
 }
Exemple #5
0
        public viewSamples()
        {
            InitializeComponent();
            Design.curve(this);
            timer1.Start();
            conn          = new DBconnect();
            temp          = viewSmaster.ID();
            chkUsd        = viewSmaster.CheckUsd();
            chkOrd        = viewSmaster.CheckOid();
            datChk        = viewSmaster.CheckDate();
            picChk        = viewSmaster.CheckPic();
            sat           = viewSmaster.CheckSat();
            textBox1.Text = Convert.ToString(chkUsd);



            /*    string temp = Login.profPic;
             *   prof_pb.Image = Image.FromFile(temp);
             *   prof_pb.SizeMode = PictureBoxSizeMode.StretchImage;
             *   prof_pb.BorderStyle = BorderStyle.None;
             *   profPic_pnl.BackColor = Color.FromArgb(93, 210, 85);
             *   string tmpName = Login.uName;
             *   nm_lbl.Text = tmpName + " !";*/

            // CultureInfo sl = new CultureInfo("EN-IN");
            //  cost_txt.Text = i.ToString("c",sl);
        }
Exemple #6
0
 public addOrd()
 {
     InitializeComponent();
     con = new DBconnect();
     Design.curve(this);
     timer1.Start();
     this.oDate.Value = DateTime.Now;
 }
Exemple #7
0
 static void Main()
 {
     DBconnect dbc = new DBconnect();
     dbc.OpenOleDb();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
     dbc.CloseOleDb();
 }
Exemple #8
0
        public viewPay()
        {
            InitializeComponent();
            conn = new DBconnect();
            Design.curve(this);
            timer1.Start();

            /* string temp = Login.profPic;
            *  prof_pb.Image = Image.FromFile(temp);
            *  prof_pb.SizeMode = PictureBoxSizeMode.StretchImage;
            *  prof_pb.BorderStyle = BorderStyle.None;
            *  profPic_pnl.BackColor = Color.FromArgb(93,210,85);
            *  string tmpName = Login.uName;
            *  nm_lbl.Text = tmpName + " !";*/
        }
Exemple #9
0
        public addSamples()
        {
            InitializeComponent();
            Design.curve(this);
            timer1.Start();
            conn = new DBconnect();


            /* string temp = Login.profPic;
            *  prof_pb.Image = Image.FromFile(temp);
            *  prof_pb.SizeMode = PictureBoxSizeMode.StretchImage;
            *  prof_pb.BorderStyle = BorderStyle.None;
            *  profPic_pnl.BackColor = Color.FromArgb(93, 210, 85);
            *  string tmpName = Login.uName;
            *  nm_lbl.Text = tmpName + " !";*/

            // CultureInfo sl = new CultureInfo("EN-IN");
            //  cost_txt.Text = i.ToString("c",sl);
        }
        public viewPmaster(string pId, string oId, string bc, string val_usd, string val_lkr, string pdate, string pt)
        {
            InitializeComponent();
            conn = new DBconnect();
            loadCombo();

            pid_txt.Text = pId;
            oid_cmb.Text = oId;
            bc_txt.Text  = bc;
            val_txt.Text = val_usd;
            pd_dtp.Text  = pdate;
            pt_cmb.Text  = pt;
            lkr_txt.Text = val_lkr;

            pid_txt.Tag = 0;
            oid_cmb.Tag = 0;
            bc_txt.Tag  = 0;
            val_txt.Tag = 0;
            pd_dtp.Tag  = 0;
            pt_cmb.Tag  = 0;
        }
        public viewSmaster(string samId, string OId, string date, string usd, string lkr, string stat)
        {
            conn = new DBconnect();
            InitializeComponent();
            new ToolTip().SetToolTip(pic_pb, "Double click to add a new picture");

            loadCombo();
            loadPicture(samId);

            sam_txt.Text     = samId;
            oid_cmb.Text     = OId;
            date_dtp.Text    = date;
            costUsd_txt.Text = usd;
            costLkr_txt.Text = lkr;
            sat_cmb.Text     = stat;
            sId             = samId;
            costUsd_txt.Tag = 0;
            oid_cmb.Tag     = 0;
            date_dtp.Tag    = 0;
            pic_pb.Tag      = 0;
            sat_cmb.Tag     = 0;
        }
Exemple #12
0
        public static string getName(TextBox un, TextBox pw)
        {
            string    name;
            DBconnect conn = new DBconnect();

            conn.DBopen();
            try
            {
                conn.SqlQuery("SELECT user_name from login WHERE user_name = '" + un.Text + "' AND password ='******' ");
                DataTable     dt = conn.SelQryEx();
                SqlDataReader re = conn.SelQryRedEx();
                re.Read();
                name = (string)(re[0]);
                return(name);
            }
            catch (Exception er)
            {
                return(null);
            }
            finally
            {
                conn.DBclose();
            }
        }
Exemple #13
0
        public static void login(TextBox un, TextBox pw, Label l, Form lgfrm, PictureBox p1, PictureBox p2)
        {
            DBconnect conn = new DBconnect();

            conn.DBopen();

            try
            {
                conn.SqlQuery("SELECT user_name,password,desig from login WHERE user_name = '" + un.Text + "' AND password ='******' ");
                DataTable     dt = conn.SelQryEx();
                SqlDataReader re = conn.SelQryRedEx();
                re.Read();

                if (un.Text == "User Name" || pw.Text == "Password")
                {
                    MessageBox.Show("Please enter the user name and the password");
                    p1.Image     = Resources.userRed;
                    p2.Image     = Resources.locked_padlockR;
                    un.Text      = "User Name";
                    un.ForeColor = Color.FromArgb(218, 214, 218);
                    pw.Text      = "Password";
                    pw.ForeColor = Color.FromArgb(218, 214, 218);
                }

                else
                {
                    if (dt.Rows.Count == 0)
                    {
                        MessageBox.Show("Invalid Username or Password.");
                        un.Clear();
                        pw.Clear();
                        l.Text              = "Wrong username or password.Try again.";
                        l.ForeColor         = Color.FromArgb(232, 17, 35);
                        l.Visible           = true;
                        lgfrm.ActiveControl = un;
                        p1.Image            = Resources.userRed;
                        p2.Image            = Resources.locked_padlockR;
                    }
                    else
                    {
                        l.Visible = false;
                        if (re.HasRows)
                        {
                            string desig = (string)(re[2]);

                            if (desig == "Sales")
                            {
                                dash frm = new dash();
                                lgfrm.Visible = false;
                                frm.ShowDialog();
                            }

                            else if (desig == "Account")
                            {
                                AccountingManagementSysem.Hm frm = new AccountingManagementSysem.Hm();
                                lgfrm.Visible = false;
                                frm.ShowDialog();
                            }

                            else if (desig == "Manu")
                            {
                                Manufacturing_Management_System.manudashboard frm = new Manufacturing_Management_System.manudashboard();
                                lgfrm.Visible = false;
                                frm.ShowDialog();
                            }
                            else if (desig == "Purch")
                            {
                                Project001.viewinvoice frm = new Project001.viewinvoice();
                                lgfrm.Visible = false;
                                frm.ShowDialog();
                            }
                            else if (desig == "Ship")
                            {
                                Package_and_shipment.homepage frm = new Package_and_shipment.homepage();
                                lgfrm.Visible = false;
                                frm.ShowDialog();
                            }
                            else if (desig == "Main")
                            {
                                AccountingManagementSysem.Hm frm = new AccountingManagementSysem.Hm();
                                lgfrm.Visible = false;
                                frm.ShowDialog();
                            }
                        }
                    }
                }
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message);
            }

            finally
            {
                conn.DBclose();
            }
        }
Exemple #14
0
 public Form2()
 {
     InitializeComponent();
     conn = new DBconnect();
 }