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 btnLoad_Click(object sender, EventArgs e) { if (_type == "QD") { BUS.LIST_QDControl control = new BUS.LIST_QDControl(); dt = control.ToTransferInStruct(); dt.TableName = "Table"; foreach (DataColumn col in dt.Columns) { col.DataType = typeof(string); } } else if (_type == "QDADD") { BUS.LIST_QD_SCHEMAControl control = new BUS.LIST_QD_SCHEMAControl(); dt = control.ToTransferInStruct(); dt.TableName = "Table"; foreach (DataColumn col in dt.Columns) { col.DataType = typeof(string); } } else if (_type == "TASK") { BUS.LIST_TASKControl control = new BUS.LIST_TASKControl(); dt = control.ToTransferInStruct(); dt.TableName = "Table"; foreach (DataColumn col in dt.Columns) { col.DataType = typeof(string); } } else if (_type == "POD") { BUS.PODControl control = new BUS.PODControl(); dt = control.ToTransferInStruct(); dt.TableName = "Table"; foreach (DataColumn col in dt.Columns) { col.DataType = typeof(string); } } BUS.CommonControl commonCtr = new BUS.CommonControl(); try { dt.ReadXml(txtFileName.Text); dt = commonCtr.ValidatedDataTransferIn(dt, _type); radGridView1.DataSource = dt; radGridView1.RetrieveStructure(); radGridView1.RootTable.Columns["tmp_Validated"].Visible = false; } catch { } }
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); }
private void btnImport_Click(object sender, EventArgs e) { string sErr = ""; BUS.LIST_QDControl control = new BUS.LIST_QDControl(); BUS.LIST_QD_SCHEMAControl controlADD = new BUS.LIST_QD_SCHEMAControl(); BUS.LIST_TASKControl controlTASK = new BUS.LIST_TASKControl(); BUS.PODControl controlPOD = new BUS.PODControl(); try { foreach (DataRow row in dt.Rows) { if ((bool)row["tmp_Validated"] == true) { if (_type == "QD") { control.TransferIn(row, ref sErr); } else if (_type == "QDADD") { sErr = controlADD.TransferIn(row); } else if (_type == "TASK") { sErr = controlTASK.TransferIn(row); } else if (_type == "POD") { sErr = controlPOD.TransferIn(row); } } } Close(); } catch { } }