示例#1
0
        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();
            }
        }
示例#2
0
文件: frmPOD.cs 项目: mwilian/demos
 private void SetDataToForm(DTO.PODInfo obj)
 {
     txtCode.Text     = obj.USER_ID;
     txtName.Text     = obj.USER_NAME;
     txtGroup.Text    = obj.ROLE_ID;
     txtDB.Text       = obj.DB_DEFAULT;
     txtLanguage.Text = obj.LANGUAGE;
 }
示例#3
0
 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();
 }
示例#4
0
文件: frmPOD.cs 项目: mwilian/demos
 private DTO.PODInfo GetDataFromForm(DTO.PODInfo obj)
 {
     //DTO.PODInfo obj = new DTO.PODInfo();
     obj.USER_ID    = obj.USER_ID1 = txtCode.Text;
     obj.USER_NAME  = txtName.Text;
     obj.ROLE_ID    = txtGroup.Text;
     obj.LANGUAGE   = txtLanguage.Text;
     obj.DB_DEFAULT = txtDB.Text;
     obj.TB         = "POD";
     return(obj);
 }
示例#5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            Form_QD.DB = txtdatabase.Text;
            if (_user != "TVC" && checkBox1.Checked)
            {
                BUS.PODControl podCtr = new PODControl();
                DTO.PODInfo    podInf = podCtr.Get(_user, ref sErr);
                podInf.DB_DEFAULT = txtdatabase.Text;
                podCtr.Update(podInf);
            }
            BUS.DBAControl dbaCtr = new DBAControl();
            DTO.DBAInfo    dbaInf = dbaCtr.Get(txtdatabase.Text, ref sErr);
            reportDir = dbaInf.REPORT_TEMPLATE_DRIVER;

            DialogResult = DialogResult.OK;
            Close();
        }
示例#6
0
文件: frmPOD.cs 项目: mwilian/demos
        private void btnSave_Click(object sender, EventArgs e)
        {
            //string sErr = "";

            DTO.PODInfo inf = new DTO.PODInfo();

            if (_processStatus == "C")
            {
                if (!ctr.IsExist(txtCode.Text))
                {
                    inf.PASS = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes("")));
                    ctr.Add(GetDataFromForm(inf), ref _sErr);
                }
                else
                {
                    _sErr = txtCode.Text.Trim() + " is exist!";
                }
            }
            else if (_processStatus == "A")
            {
                inf = ctr.Get(txtCode.Text, ref _sErr);
                if (flagPass)
                {
                    inf.PASS = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes("")));
                }
                _sErr = ctr.Update(GetDataFromForm(inf));
            }
            if (_sErr == "")
            {
                _processStatus = "V";
                EnabledForm(false);
            }
            else
            {
                lbErr.Text = _sErr;
            }
        }