コード例 #1
0
        public virtual Sec_TDataTable GetData()
        {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            Sec_TDataTable secTDataTable = new Sec_TDataTable();

            this.Adapter.Fill(secTDataTable);
            return(secTDataTable);
        }
コード例 #2
0
        public virtual int Fill(Sec_TDataTable dataTable)
        {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            if (this.ClearBeforeFill)
            {
                dataTable.Clear();
            }
            int num = this.Adapter.Fill(dataTable);

            return(num);
        }
コード例 #3
0
ファイル: Check.cs プロジェクト: MarwaAlhazmi/EasyAcc
        public bool autherized(out string name)
        {
            string            str;
            Sec_TTableAdapter secTTableAdapter;
            bool flag;

            try
            {
                str = "";
                ManagementObjectSearcher managementObjectSearcher = new ManagementObjectSearcher("Select * From Win32_processor");
                foreach (ManagementObject managementObject in managementObjectSearcher.Get())
                {
                    str = managementObject["ProcessorID"].ToString();
                }
                if (string.IsNullOrEmpty(str))
                {
                    throw new Exception("No Data");
                }
                secTTableAdapter = new Sec_TTableAdapter();
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            try
            {
                Sec_TDataTable dataByValue = secTTableAdapter.GetDataByValue("PR", this.hash(str));
                if (dataByValue.Count && dataByValue[0].Value == this.hash(str))
                {
                    flag = true;
                }
                else
                {
                    flag = false;
                    if (secTTableAdapter != null)
                    {
                        secTTableAdapter.Dispose();
                    }
                }
            }
            finally
            {
            }
            return(flag);
        }
コード例 #4
0
        public virtual Sec_TDataTable GetDataByValue(string type, string value)
        {
            this.Adapter.SelectCommand = this.CommandCollection[1];
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }
            this.Adapter.SelectCommand.Parameters[0].Value = type;
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            this.Adapter.SelectCommand.Parameters[1].Value = value;
            Sec_TDataTable secTDataTable = new Sec_TDataTable();

            this.Adapter.Fill(secTDataTable);
            return(secTDataTable);
        }
コード例 #5
0
 public virtual int Update(Sec_TDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }