Exemplo n.º 1
0
        public WageData Select(string tableName, string date)
        {
            SQLiteCommand    command;
            SQLiteDataReader reader;
            WageData         scheduleData = new WageData();
            string           sql          = "where Date=\"" + date + "\"";

            string year = SplitString(date, '-')[0];

            sqlliteManager.DBOpen();

            command = sqlliteManager.Select(tableName + year, sql);
            reader  = command.ExecuteReader();

            while (reader.Read())
            {
                scheduleData.Date          = reader["Date"].ToString();
                scheduleData.OnTime        = reader["OnTime"].ToString();
                scheduleData.OffTime       = reader["OffTime"].ToString();
                scheduleData.Time          = reader["Time"].ToString();
                scheduleData.RestTime      = reader["RestTime"].ToString();
                scheduleData.ExtensionTime = reader["ExtensionTime"].ToString();
                scheduleData.NightTime     = reader["NightTime"].ToString();
                scheduleData.TotalTime     = reader["TotalTime"].ToString();
                scheduleData.Wage          = reader["Wage"].ToString();
                scheduleData.RestWage      = reader["RestWage"].ToString();
                scheduleData.ExtensionWage = reader["ExtensionWage"].ToString();
                scheduleData.NightWage     = reader["NightWage"].ToString();
                scheduleData.TotalWage     = reader["TotalWage"].ToString();
            }

            sqlliteManager.DBClose();

            return(scheduleData);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 스케줄 데이터를 검색
        /// </summary>
        /// <param name="tableName">테이블명</param>
        /// <param name="startDate">시작날짜</param>
        /// <param name="endDate">마지막날짜</param>
        /// <param name="phone">핸드폰번호</param>
        /// <returns>데이터가 들어간 딕셔너리</returns>
        public Dictionary <string, List <ScheduleData> > Select(string tableName, string startDate, string endDate, string phone)
        {
            SQLiteCommand    command;
            SQLiteDataReader reader;
            Dictionary <string, List <ScheduleData> > scheduleDatas = new Dictionary <string, List <ScheduleData> >();
            string sql = "where Date Between \"" + startDate + "\" and \"" + endDate + "\"";

            if (!phone.Equals(""))
            {
                sql = sql + " and Phone=\"" + phone + "\"";
            }

            sql = sql + " ORDER by Phone, Date";

            sqliteManager.DBOpen();

            command = sqliteManager.Select(tableName, sql);

            reader = command.ExecuteReader();

            string phoneInedx = "";
            List <ScheduleData> scheduleList = new List <ScheduleData>();
            ScheduleData        scheduleData1;

            while (reader.Read())
            {
                scheduleData1 = new ScheduleData();

                scheduleData1.Phone = reader["Phone"].ToString();

                if (phoneInedx.Equals(""))
                {
                    phoneInedx = scheduleData1.Phone;
                }
                else if (!phoneInedx.Equals(scheduleData1.Phone))
                {
                    scheduleDatas.Add(phoneInedx, scheduleList);
                    phoneInedx   = scheduleData1.Phone;
                    scheduleList = new List <ScheduleData>();
                }

                scheduleData1.Date    = reader["Date"].ToString();
                scheduleData1.OnTime  = reader["OnTime"].ToString();
                scheduleData1.OffTime = reader["OffTime"].ToString();

                scheduleList.Add(scheduleData1);
            }

            scheduleDatas.Add(phoneInedx, scheduleList);
            sqliteManager.DBClose();

            return(scheduleDatas);
        }
        private void btnSecession_Click(object sender, RoutedEventArgs e)
        {
            SQLiteManager sqliteManager = MainWindow.GetSqliteManager();

            string sql = "where Phone=\"" + tbPhone2.Text + "\"";

            sqliteManager.DBOpen();

            if (MyMessageBox.createMessageBox(2, "이름 : " + cbName.Text + " 핸드폰번호 : " + tbPhone2.Text + " 사용자를 삭제하시겠습니까?", "회원삭제확인") == 0)
            {
                sqliteManager.Delete(SQLiteData.TableMember, sql);
                sqliteManager.Drop(tbPhone2.Text);

                Thread thread = new Thread(() => MainWindow.runThread(3, MySQLData.TableMember, sql));
                thread.Start();
            }

            sqliteManager.DBClose();

            if (MemberData.GetMemberData.Phone == tbPhone2.Text)
            {
                TransitionPage.TransitionPages(0);
            }

            initCBSecession();
        }
Exemplo n.º 4
0
        public AuthorityData Select()
        {
            SQLiteDataReader rdr;
            SQLiteCommand    command;
            string           sql = " where Authority=" + MemberData.GetMemberData.AuthorityData.Authority;

            dBConn.DBOpen();

            command = dBConn.Select(SQLiteData.TableAuthority, sql);
            rdr     = command.ExecuteReader();

            AuthorityData authorityData = new AuthorityData();

            while (rdr.Read())
            {
                authorityData.Authority = Convert.ToInt32(rdr["Authority"]);
                authorityData.SignUp    = Convert.ToInt32(rdr["SignUp"]);
                authorityData.Remove    = Convert.ToInt32(rdr["Remove"]);
                authorityData.Modify    = Convert.ToInt32(rdr["Modify"]);
                authorityData.Search    = Convert.ToInt32(rdr["Search"]);
                authorityData.Schedule  = Convert.ToInt32(rdr["Schedule"]);
            }

            dBConn.DBClose();

            return(authorityData);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 사용자 데이터 검색
        /// </summary>
        /// <param name="loginData">입력된 사용자 데이터</param>
        /// <returns>검색된 사용자 데이터</returns>
        public LoginData Select(LoginData loginData)
        {
            SQLiteDataReader rdr;
            SQLiteCommand    command;
            LoginData        login = new LoginData();
            string           sql;

            sql = "where Phone=\"" + loginData.Phone + "\"";

            sqliteManager.DBOpen();

            command = sqliteManager.Select(SQLiteData.TableMember, sql);
            rdr     = command.ExecuteReader();

            while (rdr.Read())
            {
                login.Phone    = rdr["Phone"].ToString();
                login.Password = rdr["Password"].ToString();
            }

            sqliteManager.DBClose();

            return(login);
        }