public UserType GetUserTypeById(string companyCode, string userType)
    {
        UserType       user    = new UserType();
        MSystemService mSystem = new MSystemService();
        DataTable      dt      = mSystem.ExecuteDataSet("GetUserTypeByUserTypeCode", new string[] { companyCode, userType }).Tables[0];


        if (dt.Rows.Count == 0)
        {
            user.StatusCode = Globals.FAILURE_STATUS_CODE;
            user.StatusDesc = "USER TYPE WITH ID [" + userType + "] NOT FOUND";
            return(user);
        }

        DataRow dr = dt.Rows[0];

        user.UserTypeCode = dr["UserTypeCode"].ToString();
        user.UserTypeName = dr["UserTypeName"].ToString();
        user.IsActive     = dr["IsActive"].ToString();
        user.ModifiedBy   = dr["ModifiedBy"].ToString();
        user.CreatedBy    = dr["CreatedBy"].ToString();
        user.CompanyCode  = dr["CompanyCode"].ToString();

        if (user.IsActive.ToUpper() != "TRUE")
        {
            user.StatusCode = Globals.FAILURE_STATUS_CODE;
            user.StatusDesc = "USERTYPES WITH ID [" + userType + "] ARE DEACTIVATED. ie Role Has Been Deactived. PLEASE CONTACT SYSTEM ADMINISTRATORS";
            return(user);
        }

        user.StatusCode = Globals.SUCCESS_STATUS_CODE;
        user.StatusDesc = Globals.SUCCESS_STATUS_TEXT;
        return(user);
    }
    public Company GetCompanyByCompanyCode(string CompanyCode)
    {
        Company        company = new Company();
        MSystemService mSystem = new MSystemService();
        DataTable      dt      = mSystem.ExecuteDataSet("GetCompanyByCompanyCode", new string[] { CompanyCode }).Tables[0];


        if (dt.Rows.Count == 0)
        {
            company.StatusCode = Globals.FAILURE_STATUS_CODE;
            company.StatusDesc = "COMPANY WITH ID [" + CompanyCode + "] NOT FOUND";
            return(company);
        }

        DataRow dr = dt.Rows[0];

        company.CompanyName         = dr["CompanyName"].ToString();
        company.CompanyContactEmail = dr["CompanyContactEmail"].ToString();
        company.IsActive            = dr["IsActive"].ToString();
        company.ModifiedBy          = dr["ModifiedBy"].ToString();
        company.CreatedBy           = dr["CreatedBy"].ToString();
        company.NavBarTextColor     = dr["NavBarTextColor"].ToString();
        company.PathToLogoImage     = dr["PathToLogoImage"].ToString();
        company.ThemeColor          = dr["ThemeColor"].ToString();
        company.CompanyCode         = dr["CompanyCode"].ToString();

        if (company.IsActive.ToUpper() != "TRUE")
        {
            company.StatusCode = Globals.FAILURE_STATUS_CODE;
            company.StatusDesc = "COMPANY WITH ID [" + CompanyCode + "] IS DEACTIVATED. PLEASE CONTACT SYSTEM ADMINISTRATORS";
            return(company);
        }

        company.StatusCode = Globals.SUCCESS_STATUS_CODE;
        company.StatusDesc = Globals.SUCCESS_STATUS_TEXT;
        return(company);
    }