Exemplo n.º 1
0
        public clsWDataSet.clsReturnObject ExecSP(string strSPName)
        {
            clsWDataSet objWDataSet = new clsWDataSet();

            try
            {
                clsWDataSet.clsReturnObject objReturnObject = new clsWDataSet.clsReturnObject();

                objReturnObject = objWDataSet.GetAllRecordsByNID(strSPName);
                return(objReturnObject);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 2
0
        public clsWDataSet.clsReturnObject ExecSP(string strSPName, string[] strKeyName, object[] strKeyValue, int CommandTimeOut)
        {
            clsWDataSet objWDataSet = new clsWDataSet();

            try
            {
                clsWDataSet.clsReturnObject objReturnObject = new clsWDataSet.clsReturnObject();


                objReturnObject = objWDataSet.GetAllRecordsByNID(strSPName, strKeyName, strKeyValue, CommandTimeOut);
                return(objReturnObject);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 3
0
        public bool ChangeHashPassword(string EmpIndex, string OldPassword, string NewPassword, bool Isforcibly, int UserType)
        {
            try
            {
                SHA256        sha = new SHA256Managed();
                ASCIIEncoding ae  = new ASCIIEncoding();
                clsWDataSet.clsReturnObject strResult = new clsWDataSet.clsReturnObject();
                bool Result = false;

                Byte[] OldPassData     = ae.GetBytes(OldPassword);
                Byte[] NewPassData     = ae.GetBytes(NewPassword);
                Byte[] OldPassDigest   = sha.ComputeHash(OldPassData);
                Byte[] NewPassDigest   = sha.ComputeHash(NewPassData);
                var    OldPasswordHash = BytesToStringConverted(OldPassDigest);
                var    NewPasswordHash = BytesToStringConverted(NewPassDigest);
                //var OldPasswordHash = System.Text.Encoding.UTF8.GetString(OldPassDigest, 0, OldPassDigest.Length);
                //var NewPasswordHash = Encoding.Unicode.GetString(NewPassDigest, 0, NewPassDigest.Length);



                string[] strFieldName  = { "EmployeeIndex", "OldPasswordHash", "NewPasswordHash", "IsForcibly", "UserType" };
                object[] objFieldValue = { EmpIndex, OldPasswordHash, NewPasswordHash, Isforcibly, UserType };

                strResult = ExecSP("App_um_Hash_ChangePassword", strFieldName, objFieldValue);

                if (strResult.dstResult.Tables.Count > 0)
                {
                    if (Convert.ToInt16(strResult.dstResult.Tables[0].Rows[0]["Result"].ToString()) == 1)
                    {
                        Result = true;
                    }

                    else
                    {
                        Result = false;
                    }
                }
                return(Result);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }