Ejemplo n.º 1
0
        private void RemoveAt(int index)
        {
            DataRowView rview = dataGridView1.GetRow(index).DataRow as DataRowView;

            DTO.POSInfo inf = new DTO.POSInfo(rview.Row);
            if (_user != inf.USER_ID)
            {
                BUS.POSControl ctr = new BUS.POSControl();
                ctr.Delete(inf.USER_ID);
            }
        }
Ejemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            PODInfo inf = new PODInfo();

            _user = inf.USER_ID = txtUser.Text;
            _pass = inf.PASS = txtPass.Text;

            if (_user != "TVC" || _pass != "TVCSYS")
            {
                inf.LANGUAGE = "44";
                BUS.PODControl podCtr = new BUS.PODControl();
                if (podCtr.IsExist(inf.USER_ID))
                {
                    string pass = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(inf.PASS)));

                    inf          = podCtr.Get(inf.USER_ID, ref _sErr);
                    inf.LANGUAGE = inf.LANGUAGE == "84" ? "84" : "44";

                    if (inf.PASS == pass)
                    {
                        BUS.POSControl posCtr = new BUS.POSControl();
                        if (!posCtr.IsExist(inf.USER_ID))
                        {
                            DialogResult = DialogResult.OK;
                            _DB          = inf.DB_DEFAULT;

                            DTO.POSInfo infPOS = new POSInfo(inf.USER_ID, _DB, "Query Designer", "QD", DateTime.Now.ToString("yyyy-MM-dd hh:mm"));
                            posCtr.InsertUpdate(infPOS);
                            Close();
                        }
                        else
                        {
                            lbErr.Text = "Existing users in the system";
                        }
                    }
                    else
                    {
                        lbErr.Text = "Password wrong!";
                    }
                }
                else
                {
                    lbErr.Text = "User is not exist!";
                }
            }
            else
            {
                DialogResult = DialogResult.OK;
                Close();
            }
        }
Ejemplo n.º 3
0
 private void LoadDataGrid()
 {
     BUS.POSControl ctr = new BUS.POSControl();
     dataGridView1.DataSource = ctr.GetAll(ref sErr);
 }