예제 #1
0
        //add by tctseng 2012 / 02 / 06
        public static int MLASUser_UPDATE_User_Information(object cUserAccount, object cPasswd, object cUserName, object cAuthority, object cEmail, object cYearly, object cHospital, object cOrganization, object cJopGrade, object cBirthday, object cGroup)
        {
            string strSQL = "UPDATE MLAS_User SET  cPasswd=@cPasswd , cUserName=@cUserName , cAuthority=@cAuthority , cEmail=@cEmail , cYearly=@cYearly , cHospital=@cHospital , cOrganization=@cOrganization , cJopGrade=@cJopGrade , cBirthday=@cBirthday , cGroup=@cGroup WHERE cUserAccount LIKE @cUserAccount ";

            object[] pList = { MLASUtil.HashEncryption(cPasswd), cUserName, cAuthority, cEmail, cYearly, cHospital, cOrganization, cJopGrade, cBirthday, cGroup, cUserAccount };
            try
            {
                clsMLASDB MLASDB = new clsMLASDB();
                MLASDB.ExecuteNonQuery(strSQL, pList);
            }
            catch
            {
                return(-1);
            }

            return(0);
        }
예제 #2
0
        public static int MLASUser_UPDATE_Passwd(object cUserID, object cPasswdNew)
        {
            string strSQL = "UPDATE MLAS_User SET cPasswd=@cPasswdNew WHERE cUserID LIKE @cUserID ";

            object[] pList = { MLASUtil.HashEncryption(cPasswdNew), cUserID };
            try
            {
                clsMLASDB MLASDB = new clsMLASDB();
                MLASDB.ExecuteNonQuery(strSQL, pList);
            }
            catch
            {
                return(-1);
            }

            return(0);
        }
예제 #3
0
        public static int MLASUser_INSERT(object cUserAccount, object cPasswd, object cUserName, object cAuthority, object cEmail, object cYearly, object cHospital, object cOrganization, object cJopGrade, object cBirthday, object cGroup)
        {
            string strSQL = "INSERT MLAS_User(cUserAccount,cPasswd,cUserName,cAuthority,cEmail,cYearly,cHospital,cOrganization,cJopGrade,cBirthday,cGroup) " +
                            " VALUES(@cUserAccount,@cPasswd,@cUserName,@cAuthority,@cEmail,@cYearly,@cHospital,@cOrganization,@cJopGrade,@cBirthday,@cGroup) ";

            object[] pList = { cUserAccount, MLASUtil.HashEncryption(cPasswd), cUserName, cAuthority, cEmail, cYearly, cHospital, cOrganization, cJopGrade, cBirthday, cGroup };
            try
            {
                clsMLASDB MLASDB = new clsMLASDB();
                MLASDB.ExecuteNonQuery(strSQL, pList);
            }
            catch
            {
                return(-1);
            }

            return(0);
        }
예제 #4
0
        public static bool MLASUser_CHECK_Login(object cUserAccount, object cPasswd)
        {
            clsMLASDB MLASDB = new clsMLASDB();
            string    strSQL = "SELECT * FROM MLAS_User WHERE cUserAccount=@cUserAccount AND cPasswd=@cPasswd ";

            object[] pList = { cUserAccount, MLASUtil.HashEncryption(cPasswd) };//密碼解密
            try
            {
                if (MLASDB.ExecuteDataTable(strSQL, pList).Rows.Count > 0)
                {
                    return(true);
                }
            }
            catch
            {
                return(false);
            }

            return(false);
        }