Exemple #1
0
        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 { }
        }
Exemple #2
0
        private void btSave_Click(object sender, EventArgs e)
        {
            BUS.CommonControl ctr = new BUS.CommonControl();

            DataTable dt = dgvList.DataSource as DataTable;

            if (dt != null)
            {
                ctr.executeNonQuery("Delete from LIST_EMAIL");
                string query = "";
                foreach (DataRow row in dt.Rows)
                {
                    query += " insert into LIST_EMAIL(Mail, _Name,Lookup) values('" + row["Mail"].ToString() + "','" + row["_Name"].ToString() + "','" + row["Lookup"].ToString() + "')";
                }
                ctr.executeNonQuery(query);
            }
            DialogResult = DialogResult.OK;
            Close();
        }
Exemple #3
0
        private DTO.License GetDataFromForm()
        {
            DTO.License result = new DTO.License();
            result.CompanyName  = txtCompany.Text.Trim();
            result.SerialNumber = txtSerial.Text.Trim();
            result.NumUsers     = Convert.ToInt32(txtNumUser.Text);
            string qd    = ckbQD.Checked == true ? "Y" : " ";
            string add   = ckbAddin.Checked == true ? "Y" : " ";
            string web   = ckbWeb.Checked == true ? "Y" : " ";
            string qdadd = ckbQDADD.Checked == true ? "Y" : " ";
            string task  = ckbTask.Checked == true ? "Y" : " ";

            result.Modules = qd + add + web + qdadd + task;
            DateTime dateExpire = dtExpiryDate.Value;

            result.ExpiryDate = dateExpire.Year * 10000 + dateExpire.Month * 100 + dateExpire.Day;
            result.Key        = txtKey.Text.Trim();
            BUS.CommonControl ctr = new BUS.CommonControl();
            result.SerialCPU = ctr.executeScalar(@"SELECT   CONVERT(varchar(200), SERVERPROPERTY('servername'))").ToString(); //"BFEBFBFF000006FD";
            return(result);
        }
Exemple #4
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            DTO.License license = GetDataFromForm();
            string      param   = license.CompanyName + license.SerialNumber + license.NumUsers.ToString() + license.Modules + license.ExpiryDate.ToString() + license.SerialCPU;


            string tmp = RC2.EncryptString(param, _key, _iv, _padMode, _opMode);
            string key = Convert.ToBase64String(new System.Security.Cryptography.SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(tmp)));

            if (key == license.Key)
            {
                String kq = license.CompanyName + ";" +
                            license.ExpiryDate + ";" +
                            license.Modules + ";" +
                            license.NumUsers + ";" +
                            license.SerialNumber + ";" +
                            license.Key + ";" +
                            license.SerialCPU;


                BUS.CommonControl ctr    = new BUS.CommonControl();
                string            query  = @"if EXISTS(SELECT INS_KEY  FROM SSINSTAL WHERE INS_TB='LCS' and INS_KEY='QD') 
UPDATE SSINSTAL SET SUN_DATA = '{0}' WHERE INS_TB='LCS' and INS_KEY='QD'
else 
INSERT INTO SSINSTAL(INS_TB ,INS_KEY ,SUN_DATA) VALUES ( 'LCS' ,'QD' ,'{0}')";
                string            result = RC2.EncryptString(kq, _key, _iv, _padMode, _opMode);
                query = string.Format(query, result);
                ctr.executeNonQuery(query);
                //StreamWriter writerStream = new StreamWriter(_pathLicense.Replace("file:\\", ""));
                //writerStream.WriteLine(result);
                //writerStream.Close();

                Close();
                DialogResult = DialogResult.OK;
            }
            else
            {
                lbErr.Text = "Registry fail";
            }
        }
Exemple #5
0
        private void FrmLicense_Load(object sender, EventArgs e)
        {
            lbErr.Text = "";
            BUS.CommonControl ctr  = new BUS.CommonControl();
            object            data = ctr.executeScalar(@"SELECT SUN_DATA  FROM SSINSTAL WHERE INS_TB='LCS' and INS_KEY='QD'");

            if (data != null)// if (File.Exists(_pathLicense.Replace("file:\\", "")))
            {
                //StreamReader reader = new StreamReader(_pathLicense.Replace("file:\\", ""));
                string      result  = data.ToString();
                string      kq      = RC2.DecryptString(result, _key, _iv, _padMode, _opMode);
                string[]    tmp     = kq.Split(';');
                DTO.License license = new DTO.License();
                license.CompanyName  = tmp[0];
                license.ExpiryDate   = Convert.ToInt32(tmp[1]);
                license.Modules      = tmp[2];
                license.NumUsers     = Convert.ToInt32(tmp[3]);
                license.SerialNumber = tmp[4];
                license.Key          = tmp[5];
                license.SerialCPU    = tmp[6];
                SetDataToForm(license);
                //reader.Close();
            }
        }
Exemple #6
0
 private void LoadDataGrid(string dtb)
 {
     BUS.CommonControl ctr = new BUS.CommonControl();
     dgvList.DataSource = ctr.executeSelectQuery("Select * from LIST_EMAIL");
 }
Exemple #7
0
 private void LoadListEmail()
 {
     ClearEmailUser();
     BUS.CommonControl ctr = new BUS.CommonControl();
     dgvList.DataSource = ctr.executeSelectQuery("Select * from LIST_EMAIL");
 }