Exemplo n.º 1
0
        public FixRepairModel GetFixRepairByID(int id)
        {
            SqlParameter param = new SqlParameter("@ID", SqlDbType.Int);

            param.Value = id;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetFixRepairByID", CommandType.StoredProcedure);

            dr.Read();
            FixRepairModel fixRepair = new FixRepairModel();

            if (dr.HasRows)
            {
                fixRepair.ID          = Convert.ToInt32(dr[0]);
                fixRepair.FixID       = dr[1].ToString();
                fixRepair.FixName     = dr[2].ToString();
                fixRepair.RepairDate  = Convert.ToDateTime(dr[3]);
                fixRepair.EndDate     = Convert.ToDateTime(dr[4]);
                fixRepair.MainHead    = dr[5].ToString();
                fixRepair.ServiceFee  = Convert.ToDouble(dr[6]);
                fixRepair.MaterielFee = Convert.ToDouble(dr[7]);
                fixRepair.RepairSum   = Convert.ToDouble(dr[8]);
                fixRepair.RepairMemo  = dr[9].ToString();
                fixRepair.Sign        = Convert.ToInt32(dr[10]);
                fixRepair.RepairUnit  = dr[11].ToString();
            }
            dr.Close();
            return(fixRepair);
        }
Exemplo n.º 2
0
        public List <FixRepairModel> GetFixRepairByCondition(string condition)
        {
            SqlParameter param = new SqlParameter("@Condition", SqlDbType.VarChar, 255);

            param.Value = condition;
            SqlDataReader         dr   = SqlHelp.ExecuteReader("prc_GetFixRepairByCondition", CommandType.StoredProcedure, param);
            List <FixRepairModel> list = new List <FixRepairModel>();

            while (dr.Read())
            {
                FixRepairModel fixRepair = new FixRepairModel();
                fixRepair.ID          = Convert.ToInt32(dr[0]);
                fixRepair.FixID       = dr[1].ToString();
                fixRepair.FixName     = dr[2].ToString();
                fixRepair.RepairDate  = Convert.ToDateTime(dr[3]);
                fixRepair.EndDate     = Convert.ToDateTime(dr[4]);
                fixRepair.MainHead    = dr[5].ToString();
                fixRepair.ServiceFee  = Convert.ToDouble(dr[6]);
                fixRepair.MaterielFee = Convert.ToDouble(dr[7]);
                fixRepair.RepairSum   = Convert.ToDouble(dr[8]);
                fixRepair.RepairMemo  = dr[9].ToString();
                fixRepair.Sign        = Convert.ToInt32(dr[10]);
                fixRepair.RepairUnit  = dr[11].ToString();
                list.Add(fixRepair);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 3
0
        public List <FixRepairModel> GetAllFixRepair()
        {
            SqlDataReader         dr   = SqlHelp.ExecuteReader("prc_GetAllFixRepair", CommandType.StoredProcedure);
            List <FixRepairModel> list = new List <FixRepairModel>();

            while (dr.Read())
            {
                FixRepairModel fixRepair = new FixRepairModel();
                fixRepair.ID          = Convert.ToInt32(dr[0]);
                fixRepair.FixID       = dr[1].ToString();
                fixRepair.FixName     = dr[2].ToString();
                fixRepair.RepairDate  = Convert.ToDateTime(dr[3]);
                fixRepair.EndDate     = Convert.ToDateTime(dr[4]);
                fixRepair.MainHead    = dr[5].ToString();
                fixRepair.ServiceFee  = Convert.ToDouble(dr[6]);
                fixRepair.MaterielFee = Convert.ToDouble(dr[7]);
                fixRepair.RepairSum   = Convert.ToDouble(dr[8]);
                fixRepair.RepairMemo  = dr[9].ToString();
                fixRepair.Sign        = Convert.ToInt32(dr[10]);
                fixRepair.RepairUnit  = dr[11].ToString();
                list.Add(fixRepair);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 4
0
        public List <RoomModel> GetRoomByCondition(string condition)
        {
            SqlParameter param = new SqlParameter("@Condition", SqlDbType.VarChar, 255);

            param.Value = condition;
            SqlDataReader    dr   = SqlHelp.ExecuteReader("prc_GetRoomByCondition", CommandType.StoredProcedure, param);
            List <RoomModel> list = new List <RoomModel>();

            while (dr.Read())
            {
                RoomModel room = new RoomModel();
                room.Code           = dr[0].ToString();
                room.RoomID         = dr[1].ToString();
                room.State          = Convert.ToInt32(dr[2]);
                room.PaName         = dr[3].ToString();
                room.SunnyName      = dr[4].ToString();
                room.RoomUseName    = dr[5].ToString();
                room.IndoorName     = dr[6].ToString();
                room.RoomFormatName = dr[7].ToString();
                room.BuildArea      = Convert.ToDouble(dr[8]);
                room.UseArea        = Convert.ToDouble(dr[9]);
                list.Add(room);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 5
0
        public List <BaseInfoModel> ShowBaseInfo()
        {
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_ShowBaseInfo", CommandType.StoredProcedure);

            dr.Read();
            List <BaseInfoModel> list = new List <BaseInfoModel>();

            if (dr.HasRows)
            {
                BaseInfoModel baseInfo = new BaseInfoModel();
                baseInfo.ID          = Convert.ToInt32(dr[0]);
                baseInfo.HomeName    = dr[1].ToString();
                baseInfo.MainHead    = dr[2].ToString();
                baseInfo.BuildDate   = Convert.ToDateTime(dr[3]);
                baseInfo.BuildArea   = Convert.ToDouble(dr[4]);
                baseInfo.Amount      = Convert.ToInt32(dr[5]);
                baseInfo.Address     = dr[6].ToString();
                baseInfo.GreenArea   = Convert.ToDouble(dr[7]);
                baseInfo.RoadArea    = Convert.ToDouble(dr[8]);
                baseInfo.Tel         = dr[9].ToString();
                baseInfo.ParkingArea = Convert.ToDouble(dr[10]);
                baseInfo.Memo        = dr[11].ToString();
                list.Add(baseInfo);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 6
0
        public EmployeeModel GetEmployeeByID(int id)
        {
            SqlParameter param = new SqlParameter("@ID", SqlDbType.Int);

            param.Value = id;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetEmployeeByID", CommandType.StoredProcedure, param);

            dr.Read();
            EmployeeModel employee = new EmployeeModel();

            if (dr.HasRows)
            {
                employee.EmlpoyeeName = dr[0].ToString();
                employee.Sex          = Convert.ToInt32(dr[1]);
                employee.Arrage       = dr[2].ToString();
                employee.Tel          = dr[3].ToString();
                employee.Mobile       = dr[4].ToString();
                employee.PhotoPath    = dr[5].ToString();
                employee.ID           = Convert.ToInt32(dr[6]);
                employee.Address      = dr[7].ToString();
                employee.CardID       = dr[8].ToString();
            }
            dr.Close();
            return(employee);
        }
Exemplo n.º 7
0
        public List <UserModel> UserLogin(string userName, string password)
        {
            SqlParameter[] param = { new SqlParameter("@UID", SqlDbType.VarChar, 20), new SqlParameter("@Password", SqlDbType.VarChar, 20) };
            param[0].Value = userName;
            param[1].Value = password;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_Login", CommandType.StoredProcedure, param);

            dr.Read();
            List <UserModel> list = new List <UserModel>();

            if (dr.HasRows)
            {
                UserModel user = new UserModel();
                user.ID       = Convert.ToInt32(dr[0]);
                user.SubID    = Convert.ToInt32(dr[1]);
                user.UID      = dr[2].ToString();
                user.Password = dr[3].ToString();
                user.Name     = dr[4].ToString();
                user.UserType = Convert.ToInt32(dr[5]);
                user.Code     = dr[6].ToString();
                list.Add(user);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 8
0
        public List <HomeHoldModel> GetAllHomeHold()
        {
            SqlDataReader        dr   = SqlHelp.ExecuteReader("prc_GetHomeHold", CommandType.StoredProcedure);
            List <HomeHoldModel> list = new List <HomeHoldModel>();

            while (dr.Read())
            {
                HomeHoldModel homeHold = new HomeHoldModel();
                homeHold.ID       = Convert.ToInt32(dr[0]);
                homeHold.Code     = dr[1].ToString();
                homeHold.UserName = dr[2].ToString();
                homeHold.UID      = dr[3].ToString();
                homeHold.Tel      = dr[4].ToString();
                homeHold.Contact  = dr[5].ToString();
                homeHold.Mobile   = dr[6].ToString();
                homeHold.Email    = dr[7].ToString();
                homeHold.CardID   = dr[8].ToString();
                homeHold.OwnerID  = dr[9].ToString();
                homeHold.Unit     = dr[10].ToString();
                homeHold.RoomID   = dr[11].ToString();
                list.Add(homeHold);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 9
0
        public HomeHoldModel ShowHomeHoldByID(string id)
        {
            SqlParameter param = new SqlParameter("@Code", SqlDbType.NVarChar, 20);

            param.Value = id;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_ShowHomeHoldByID", CommandType.StoredProcedure, param);

            dr.Read();
            HomeHoldModel homeHold = new HomeHoldModel();

            if (dr.HasRows)
            {
                homeHold.UserName = dr[0].ToString();
                homeHold.Tel      = dr[1].ToString();
                homeHold.Contact  = dr[2].ToString();
                homeHold.Email    = dr[3].ToString();
                homeHold.OwnerID  = dr[4].ToString();
                homeHold.Unit     = dr[5].ToString();
                homeHold.Mobile   = dr[6].ToString();
                homeHold.CardID   = dr[7].ToString();
                homeHold.Memo     = dr[8].ToString();
            }
            dr.Close();
            return(homeHold);
        }
Exemplo n.º 10
0
        public PavilionModel GetPavilionByID(string paID)
        {
            SqlParameter param = new SqlParameter("@PaID", SqlDbType.VarChar, 3);

            param.Value = paID;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetPavilionByID", CommandType.StoredProcedure, param);

            dr.Read();
            PavilionModel pavilion = new PavilionModel();

            if (dr.HasRows)
            {
                pavilion.PaID      = dr[0].ToString();
                pavilion.Name      = dr[1].ToString();
                pavilion.Layer     = Convert.ToInt32(dr[2]);
                pavilion.Height    = Convert.ToDouble(dr[3]);
                pavilion.Area      = Convert.ToDouble(dr[4]);
                pavilion.BuildDate = Convert.ToDateTime(dr[5]);
                pavilion.Memo      = dr[6].ToString();
                pavilion.TypeName  = dr[7].ToString();
                pavilion.TypeID    = Convert.ToInt32(dr[8]);
            }
            dr.Close();
            return(pavilion);
        }
Exemplo n.º 11
0
        public RoomModel GetRoomByID(string code)
        {
            SqlParameter param = new SqlParameter("@Code", SqlDbType.VarChar, 9);

            param.Value = code;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetRoomByID", CommandType.StoredProcedure, param);

            dr.Read();
            RoomModel room = new RoomModel();

            if (dr.HasRows)
            {
                room.Code           = dr[0].ToString();
                room.RoomID         = dr[1].ToString();
                room.State          = Convert.ToInt32(dr[2]);
                room.PaName         = dr[3].ToString();
                room.SunnyID        = Convert.ToInt32(dr[4]);
                room.SunnyName      = dr[5].ToString();
                room.RoomUseID      = Convert.ToInt32(dr[6]);
                room.RoomUseName    = dr[7].ToString();
                room.IndoorID       = Convert.ToInt32(dr[8]);
                room.IndoorName     = dr[9].ToString();
                room.RoomFormatID   = Convert.ToInt32(dr[10]);
                room.RoomFormatName = dr[11].ToString();
                room.BuildArea      = Convert.ToDouble(dr[12]);
                room.UseArea        = Convert.ToDouble(dr[13]);
            }
            dr.Close();
            return(room);
        }
Exemplo n.º 12
0
        public int CheckRooms(string code)
        {
            SqlParameter param = new SqlParameter("@Code", SqlDbType.VarChar, 5);

            param.Value = code;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_CheckRooms", CommandType.StoredProcedure, param);

            dr.Read();
            int result = Convert.ToInt32(dr[0]);

            return(result);
        }
Exemplo n.º 13
0
        public int CheckHomePark(int ParkID)
        {
            SqlParameter param = new SqlParameter("@ParkID", SqlDbType.Int);

            param.Value = ParkID;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_CheckHomePark", CommandType.StoredProcedure, param);

            dr.Read();
            int result = Convert.ToInt32(dr[0]);

            return(result);
        }
Exemplo n.º 14
0
        public int CheckRoom(string paID)
        {
            SqlParameter param = new SqlParameter("@PaID", SqlDbType.VarChar, 3);

            param.Value = paID;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_CheckRoomForHold", CommandType.StoredProcedure, param);

            dr.Read();
            int result = Convert.ToInt32(dr[0]);

            return(result);
        }
Exemplo n.º 15
0
        public int GetMaxID()
        {
            int           id = -1;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetPavilionMaxID", CommandType.StoredProcedure);

            dr.Read();
            if (dr[0].ToString() != "")
            {
                id = Convert.ToInt32(dr[0]);
            }
            dr.Close();
            return(id);
        }
Exemplo n.º 16
0
        public List <TypeModel> GetCodeTable()
        {
            SqlDataReader    dr   = SqlHelp.ExecuteReader("prc_GetCodeTable", CommandType.StoredProcedure);
            List <TypeModel> list = new List <TypeModel>();

            while (dr.Read())
            {
                TypeModel type = new TypeModel();
                type.ID       = Convert.ToInt32(dr[0]);
                type.TypeName = dr[1].ToString();
                list.Add(type);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 17
0
        public bool CheckUserByUID(string uid)
        {
            bool         flag  = false;
            SqlParameter param = new SqlParameter("@UID", SqlDbType.VarChar, 20);

            param.Value = uid;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_CheckUserByUID", CommandType.StoredProcedure, param);

            dr.Read();
            if (dr.HasRows)
            {
                flag = true;
            }
            dr.Close();
            return(flag);
        }
Exemplo n.º 18
0
        public List <ChargeFreeTypeModel> GetChargeFreeType()
        {
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetChargeFreeType", CommandType.StoredProcedure);
            List <ChargeFreeTypeModel> list = new List <ChargeFreeTypeModel>();

            while (dr.Read())
            {
                ChargeFreeTypeModel chargefree = new ChargeFreeTypeModel();
                chargefree.TypeID   = Convert.ToInt32(dr[0]);
                chargefree.TypeName = dr[1].ToString();
                chargefree.Price    = Convert.ToDouble(dr[2]);
                chargefree.Format   = dr[3].ToString();
                list.Add(chargefree);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 19
0
        public List <BaseParkModel> GetBasePark()
        {
            SqlDataReader        dr   = SqlHelp.ExecuteReader("prc_GetBasePark", CommandType.StoredProcedure);
            List <BaseParkModel> list = new List <BaseParkModel>();

            while (dr.Read())
            {
                BaseParkModel basePark = new BaseParkModel();
                basePark.ParkID = Convert.ToInt32(dr[0]);
                basePark.Name   = dr[1].ToString();
                basePark.Amount = Convert.ToInt32(dr[2]);
                basePark.Memo   = dr[3].ToString();
                list.Add(basePark);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 20
0
        public List <NewsModel> ShowNews()
        {
            SqlDataReader    dr   = SqlHelp.ExecuteReader("prc_ShowNews", CommandType.StoredProcedure);
            List <NewsModel> list = new List <NewsModel>();

            while (dr.Read())
            {
                NewsModel news = new NewsModel();
                news.ID            = Convert.ToInt32(dr[0]);
                news.Title         = dr[1].ToString();
                news.NoticeDate    = Convert.ToDateTime(dr[2]);
                news.NoticeContent = dr[3].ToString();
                list.Add(news);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 21
0
        public bool CheckUser(string uid, string password)
        {
            bool flag = false;

            SqlParameter[] param = { new SqlParameter("@UID", SqlDbType.VarChar, 20), new SqlParameter("@Password", SqlDbType.VarChar, 20) };
            param[0].Value = uid;
            param[1].Value = password;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_CheckUser", CommandType.StoredProcedure, param);

            dr.Read();
            if (dr.HasRows)
            {
                flag = true;
            }
            dr.Close();
            return(flag);
        }
Exemplo n.º 22
0
        public List <FixModel> GetAllFix()
        {
            SqlDataReader   dr   = SqlHelp.ExecuteReader("prc_GetAllFix", CommandType.StoredProcedure);
            List <FixModel> list = new List <FixModel>();

            while (dr.Read())
            {
                FixModel fix = new FixModel();
                fix.FixID       = dr[0].ToString();
                fix.Name        = dr[1].ToString();
                fix.Amount      = Convert.ToInt32(dr[2]);
                fix.Factory     = dr[3].ToString();
                fix.FactoryDate = Convert.ToDateTime(dr[4]);
                list.Add(fix);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 23
0
        public List <RoomModel> GetAllRoomNotUsed(string code)
        {
            SqlParameter param = new SqlParameter("@Code", SqlDbType.VarChar, 5);

            param.Value = code;
            SqlDataReader    dr   = SqlHelp.ExecuteReader("prc_GetAllRoomNotUsed", CommandType.StoredProcedure, param);
            List <RoomModel> list = new List <RoomModel>();

            while (dr.Read())
            {
                RoomModel room = new RoomModel();
                room.RoomID = dr[0].ToString();
                room.Code   = dr[1].ToString();
                list.Add(room);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 24
0
        public List <EmployeeModel> ShowEmployee()
        {
            SqlDataReader        dr   = SqlHelp.ExecuteReader("prc_ShowEmployee", CommandType.StoredProcedure);
            List <EmployeeModel> list = new List <EmployeeModel>();

            while (dr.Read())
            {
                EmployeeModel employee = new EmployeeModel();
                employee.EmlpoyeeName = dr[0].ToString();
                employee.Sex          = Convert.ToInt32(dr[1]);
                employee.Arrage       = dr[2].ToString();
                employee.Tel          = dr[3].ToString();
                employee.PhotoPath    = dr[4].ToString();
                list.Add(employee);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 25
0
        public List <TypeModel> GetType(string typeCode)
        {
            SqlParameter param = new SqlParameter("@TableName", SqlDbType.VarChar, 10);

            param.Value = typeCode;
            SqlDataReader    dr   = SqlHelp.ExecuteReader("prc_GetType", CommandType.StoredProcedure, param);
            List <TypeModel> list = new List <TypeModel>();

            while (dr.Read())
            {
                TypeModel type = new TypeModel();
                type.ID   = Convert.ToInt32(dr[0]);
                type.Name = dr[1].ToString();
                list.Add(type);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 26
0
        public List <AdModel> ShowAllAd()
        {
            SqlDataReader  dr   = SqlHelp.ExecuteReader("prc_ShowAllAd", CommandType.StoredProcedure);
            List <AdModel> list = new List <AdModel>();

            while (dr.Read())
            {
                AdModel ad = new AdModel();
                ad.ID        = Convert.ToInt32(dr[0]);
                ad.AdName    = dr[1].ToString();
                ad.PhotoPath = @"~\" + dr[2].ToString();
                ad.Url       = dr[3].ToString();
                ad.AddDate   = Convert.ToDateTime(dr[4]);
                list.Add(ad);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 27
0
        public NewsModel ShowNewsByID(int id)
        {
            SqlParameter param = new SqlParameter("@ID", SqlDbType.Int, 5);

            param.Value = id;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_ShowNewsByID", CommandType.StoredProcedure, param);

            dr.Read();
            NewsModel news = new NewsModel();

            if (dr.HasRows)
            {
                news.Title         = dr[0].ToString();
                news.NoticeDate    = Convert.ToDateTime(dr[1]);
                news.NoticeContent = dr[2].ToString();
            }
            dr.Close();
            return(news);
        }
Exemplo n.º 28
0
        public ChargeFreeTypeModel GetChargeFreeTypeByID(int typeID)
        {
            SqlParameter param = new SqlParameter("@TypeID", SqlDbType.Int);

            param.Value = typeID;
            SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetChargeFreeTypeByID", CommandType.StoredProcedure, param);

            dr.Read();
            ChargeFreeTypeModel chargefree = new ChargeFreeTypeModel();

            if (dr.HasRows)
            {
                chargefree.TypeName = dr[0].ToString();
                chargefree.Price    = Convert.ToDouble(dr[1]);
                chargefree.Format   = dr[2].ToString();
            }
            dr.Close();
            return(chargefree);
        }
Exemplo n.º 29
0
        public List <HomeRepairModel> GetHomeRepair()
        {
            SqlDataReader          dr   = SqlHelp.ExecuteReader("prc_GetHomeRepair", CommandType.StoredProcedure);
            List <HomeRepairModel> list = new List <HomeRepairModel>();

            while (dr.Read())
            {
                HomeRepairModel homerepair = new HomeRepairModel();
                homerepair.ID         = dr[0].ToString();
                homerepair.Code       = dr[1].ToString();
                homerepair.RepairDate = Convert.ToDateTime(dr[2]);
                homerepair.RepairText = dr[3].ToString();
                homerepair.Sign       = Convert.ToInt32(dr[4]);
                homerepair.RoomID     = dr[5].ToString();
                list.Add(homerepair);
            }
            dr.Close();
            return(list);
        }
Exemplo n.º 30
0
        public List <AreaFactModel> ShowAllAreafact()
        {
            SqlDataReader        dr   = SqlHelp.ExecuteReader("prc_ShowAllAreafact", CommandType.StoredProcedure);
            List <AreaFactModel> list = new List <AreaFactModel>();

            while (dr.Read())
            {
                AreaFactModel arefact = new AreaFactModel();
                arefact.ID       = Convert.ToInt32(dr[0]);
                arefact.FactName = dr[1].ToString();
                arefact.MainHead = dr[2].ToString();
                arefact.Tel      = dr[3].ToString();
                arefact.Memo     = dr[5].ToString();
                arefact.TypeName = dr[6].ToString();
                list.Add(arefact);
            }
            dr.Close();
            return(list);
        }