示例#1
0
        public User Login(User user)
        {
            StringBuilder query = new StringBuilder();
            query.Append("select sys_user_id as UserId from bfc_sys_user where user_login ='******' and user_password ='******' and active ='Y' ");
            query.Append("SELECT distinct rtrim(bfc_process.system_id), ");
            query.Append("rtrim(bfc_process.process_id), ");
            query.Append("bfc_process.process_type, ");
            query.Append("bfc_process.process_desc, ");
            query.Append("bfc_process.short_desc, ");
            query.Append("bfc_process.bitmap_graphic, ");
            query.Append("bfc_process.active, ");
            query.Append("bfc_process.insert_datetime, ");
            query.Append("bfc_process.insert_user, ");
            query.Append("bfc_process.insert_process, ");
            query.Append("bfc_process.update_datetime, ");
            query.Append("bfc_process.update_user, ");
            query.Append("bfc_process.update_process, ");
            query.Append("bfc_process.menu_sort_order, ");
            query.Append("bfc_process.hot_key ");
            query.Append("FROM bfc_process, ");
            query.Append("sec_group_process, ");
            query.Append("security_user_group, ");
            query.Append("bfc_sys_user ");
            query.Append("WHERE ( sec_group_process.system_id = bfc_process.system_id ) and ");
            query.Append("( sec_group_process.process_id = bfc_process.process_id ) and ");
            query.Append("( sec_group_process.sec_group_id = security_user_group.sec_group_id ) and ");
            query.Append("( bfc_sys_user.sys_user_id = security_user_group.sys_user_id ) and ");
            query.Append("( ( bfc_process.process_type = 'MENUOPTION' ) AND ");
            query.Append("( bfc_sys_user.user_login = '******' ) AND ");
            query.Append("( sec_group_process.select_option = 'Y' ) AND ");
            query.Append("( bfc_process.system_id = 'CMS2' )) ");
            query.Append("ORDER BY bfc_process.menu_sort_order ASC, ");
            query.Append("bfc_process.short_desc ASC   ");
            DataSet ds = database.ExecuteDataSet(System.Data.CommandType.Text, query.ToString());
            if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
            {
                //0th index is login table
                if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["UserId"] != null)
                {
                    user.UserId = int.Parse(ds.Tables[0].Rows[0]["UserId"].ToString());
                    if (ds.Tables.Count > 1)
                    {
                        user.Modules = new List<Module>();
                        // 1st index table is active module names
                        for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                        {
                            //1st index column is module name
                            user.Modules.Add(new Module { ModuleName = Convert.ToString(ds.Tables[1].Rows[i][1]) });
                        }
                    }
                }
            }

            return user;
        }
示例#2
0
		//�Private�Methods�(1)�

        User IDatabase.Login(User user)
        {
            throw new NotImplementedException();
        }
示例#3
0
 public User Login(User user)
 {
     return Database.Login(user);
 }
示例#4
0
        public User Login(User user)
        {
            try
            {
                user = _dbManager.Login(user);
            }
            catch (Exception exceptionToHandle)
            {
                ExceptionPolicy.HandleException(exceptionToHandle, "Policy");
                FaultDetail faultDetail = new FaultDetail
                {
                    Type = exceptionToHandle.Message,
                    ErrorCode = 63873928
                };     //+ throw     
                throw new FaultException<FaultDetail>(faultDetail, exceptionToHandle.Message);
            }

            return user;
        }