Ejemplo n.º 1
0
        public void Update(Staff staff)
        {
            object[] string0 = new object[] { this._tableName, staff.RealName, Regedit.EncryptTextNet(staff.Password), staff.StaffID };
            string   str     = string.Format("UPDATE  {0} set [NAME]='{1}',[PASSWORD]='{2}' where ID='{3}'", string0);
            DataAccessLayerBaseClass dataAccessLayer = DataAccessLayerFactory.GetDataAccessLayer(this._dataProviderType, this._connectionString);

            dataAccessLayer.Open();
            dataAccessLayer.ExecuteNonQuery(CommandType.Text, str);
            dataAccessLayer.Close();
        }
Ejemplo n.º 2
0
        public bool ValidePassword(string string2, string string3)
        {
            bool flag;
            DataAccessLayerBaseClass dataAccessLayer = DataAccessLayerFactory.GetDataAccessLayer(this._dataProviderType, this._connectionString);

            dataAccessLayer.Open();
            string str = Regedit.EncryptTextNet(string3);

            string[]  string0   = new string[] { "select * from ", this._tableName, " where ID='", string2, "' and PASSWORD = '******'" };
            DataTable dataTable = dataAccessLayer.ExecuteDataTable(string.Concat(string0));

            dataAccessLayer.Close();
            flag = (dataTable.Rows.Count != 0 ? true : false);
            return(flag);
        }
Ejemplo n.º 3
0
        public static bool IsValid(string string_0, string string_1, string string_2)
        {
            bool   flag;
            string str  = "";
            string str1 = Regedit.Is64or32System();

            if (str1 == "64")
            {
                str = string.Concat(string_2, ",", Regedit.GetSysManagementSerialNumber64(string_2));
            }
            else if (str1 == "32")
            {
                str = string.Concat(string_2, ",", Regedit.GetSysManagementSerialNumber(string_2));
            }
            flag = (!string_1.Equals(Regedit.EncryptPassword(string.Concat(string_0, Regedit.EncryptTextNet(str)), "md5")) ? false : true);
            return(flag);
        }
Ejemplo n.º 4
0
        public void Add(Staff staff)
        {
            object[] string0 = new object[] { this._tableName, staff.StaffID, staff.RealName, Regedit.EncryptTextNet(staff.Password) };
            string   str     = string.Format("insert into {0}([ID],[NAME],[PASSWORD]) values('{1}','{2}','{3}')", string0);
            DataAccessLayerBaseClass dataAccessLayer = DataAccessLayerFactory.GetDataAccessLayer(this._dataProviderType, this._connectionString);

            dataAccessLayer.Open();
            dataAccessLayer.ExecuteNonQuery(CommandType.Text, str);
            dataAccessLayer.Close();
        }