private void btnView_Click(object sender, EventArgs e) { frmPODView frm = new frmPODView(); if (frm.ShowDialog() == DialogResult.OK) { SetDataToForm(ctr.Get(frm.Code, ref _sErr)); EnabledForm(false); } }
private void btnOK_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; BUS.PODControl podCtr = new BUS.PODControl(); DTO.PODInfo podInf = podCtr.Get(_user, ref _sErr); string infpass = podInf.PASS; string oldpass = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(txtOld.Text))); string newpass = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(txtNew.Text))); string confirmpass = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(txtConfirm.Text))); if (infpass != oldpass) { MessageBox.Show("Wrong password"); } else if (newpass != confirmpass) { MessageBox.Show("Confirm password is not correct"); } else { podInf.PASS = newpass; _sErr = podCtr.Update(podInf); Close(); } }
private void FrmTransferOut_Load(object sender, EventArgs e) { if (_type == "QD") { BUS.LIST_QDControl control = new BUS.LIST_QDControl(); dt = control.GetTransferOut_LIST_QD(_db, QD_CODE, ref sErr); } else if (_type == "QDADD") { BUS.LIST_QD_SCHEMAControl control = new BUS.LIST_QD_SCHEMAControl(); if (QD_CODE != "") { DTO.LIST_QD_SCHEMAInfo inf = control.Get(_db, QD_CODE, ref sErr); dt = inf.ToDataTable(); dt.Rows.Add(inf.ToDataRow(dt)); dt.TableName = "Table"; } else { dt = control.GetAll(_db, ref sErr); } } else if (_type == "TASK") { BUS.LIST_TASKControl control = new BUS.LIST_TASKControl(); if (QD_CODE != "") { DTO.LIST_TASKInfo inf = control.Get(_db, QD_CODE, ref sErr); dt = DTO.LIST_TASKInfo.ToDataTable(); dt.Rows.Add(inf.ToDataRow(dt)); dt.TableName = "Table"; } else { dt = control.GetAll(_db, ref sErr); } } else if (_type == "POD") { BUS.PODControl control = new BUS.PODControl(); if (QD_CODE != "") { DTO.PODInfo inf = control.Get(QD_CODE, ref sErr); dt = DTO.PODInfo.ToDataTable(); dt.Rows.Add(inf.ToDataRow(dt)); dt.TableName = "Table"; } else { dt = control.GetAll(ref sErr); } } dtEnd = dt.Copy(); radGridView1.DataSource = dtEnd; radGridView1.RetrieveStructure(); }
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(); } }
public static string SetDataAccessGroup(string DAField, DataTable dt, string _user) { if (!dt.Columns.Contains(DAField)) { return("DAField is not exist int DataTable"); } string sErr = ""; BUS.LIST_DAControl daCtr = new BUS.LIST_DAControl(); BUS.PODControl podCtr = new BUS.PODControl(); DTO.PODInfo usrinf = podCtr.Get(_user, ref sErr); DataTable dtPermision = daCtr.GetPermissionByRole(usrinf.ROLE_ID, ref sErr); if (dtPermision.Rows.Count == 0) { dt.Rows.Clear(); } for (int i = dt.Rows.Count - 1; i >= 0; i--) { string flag = ""; bool ie = true; foreach (DataRow row in dtPermision.Rows) { if (dt.Rows[i][DAField].ToString().Trim() != "") { if (dt.Rows[i][DAField].ToString().Trim() == row["DAG_ID"].ToString()) { flag = row["EI"].ToString(); } else if (row["EI"].ToString() == "I") { ie = false; } } } if ((flag == "" && ie) || flag == "I") { } else { dt.Rows.Remove(dt.Rows[i]); } } return(sErr); }