예제 #1
0
 public void Delete(string ID)
 {
     EWC_DBHelper.RunTSQL("delete EWC_Album where AlbumID=@abid",
                          new Dictionary <string, object> {
         { "@abid", ID }
     });
 }
예제 #2
0
    //public void Update(EWC_SignUp s)
    //{
    //    EWC_DBHelper.RunTSQL("update EWC_ActivitySignUpDetail set Name=@name where ActivityID=@id",
    //        new Dictionary<string, object> {
    //            { "@id" , a.ActivityID } ,
    //            { "@name" , a.Name }
    //        });
    //}

    public void Delete(string ID)
    {
        EWC_DBHelper.RunTSQL("delete EWC_ActivitySignUpDetail where EmployeeID=@eid",
                             new Dictionary <string, object> {
            { "@eid", ID }
        });
    }
예제 #3
0
 //    if (a.note == "")
 //	{
 //        DBNull.Value
 //}else
 //a.note
 public void Update(EWC_Activity a)
 {
     EWC_DBHelper.RunTSQL("update EWC_Activity set Type=@type, Title=@title, Photo=@photo, ActivityDescription=@desc , ActiveDate=@ad , StartDate=@sd , EndDate=@ed , StartTime=@st , EndTime=@et , Location=@locat , ActivitySchedule=@sche , AllowSignUp=@as , StartSignUpDate=@ssd , EndSignUpDate=@esd , CompanyAmount=@ca , Charge=@charge , Bus=@bus , Note=@note where ActivityID=@id",
                          new Dictionary <string, object> {
         { "@id", a.ActivityID },
         { "@type", a.Type },
         { "@title", a.Title },
         { "@photo", a.Photo },
         { "@desc", a.ActivityDescription },
         { "@ad", a.ActiveDate },
         { "@sd", a.StartDate },
         { "@ed", a.EndDate },
         { "@st", a.StartTime },
         { "@et", a.EndTime },
         { "@locat", a.Location },
         { "@sche", a.ActivitySchedule },
         { "@as", a.AllowSignUp },
         { "@ssd", a.StartSignUpDate },
         { "@esd", a.EndSignUpDate },
         { "@ca", a.CompanyAmount },
         { "@charge", a.Charge },
         { "@bus", a.Bus },
         { "@note", a.Note }
     });
 }
예제 #4
0
 public void Delete(string ID)
 {
     EWC_DBHelper.RunTSQL("delete EWC_Activity where ActivityID=@id",
                          new Dictionary <string, object> {
         { "@id", ID }
     });
 }
예제 #5
0
 public void Insert(EWC_Activity a)
 {
     EWC_DBHelper.RunTSQL("insert into EWC_Activity values(@id ,@type, @title, @photo, @desc , @ad , @sd , @ed , @st , @et , @locat , @sche , @as , @ssd , @esd , @ca , @charge , @bus , @note)",
                          new Dictionary <string, object> {
         { "@id", a.ActivityID },
         { "@type", a.Type },
         { "@title", a.Title },
         { "@photo", a.Photo },
         { "@desc", a.ActivityDescription },
         { "@ad", a.ActiveDate },
         { "@sd", a.StartDate },
         { "@ed", a.EndDate },
         { "@st", a.StartTime },
         { "@et", a.EndTime },
         { "@locat", a.Location },
         { "@sche", a.ActivitySchedule },
         { "@as", a.AllowSignUp },
         { "@ssd", a.StartSignUpDate },
         { "@esd", a.EndSignUpDate },
         { "@ca", a.CompanyAmount },
         { "@charge", a.Charge },
         { "@bus", a.Bus },
         { "@note", a.Note }
     });
 }
예제 #6
0
 public void Delete(string ID)
 {
     EWC_DBHelper.RunTSQL("delete EWC_Photo where PhotoID=@pid",
                          new Dictionary <string, object> {
         { "@pid", ID }
     });
 }
예제 #7
0
    //查詢所有活動
    public List <EWC_SignUpAtv> GetSignUpAtv(string empid)
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select a.ActivityID,a.EmployeeID,b.Title,b.Type,b.StartDate,b.EndDate,b.StartTime,b.EndTime from EWC_ActivitySignUpDetail as a join EWC_Activity as b on a.ActivityID = b.ActivityID where EmployeeID = @empid",
                                                 new Dictionary <string, object> {
            { "@empid", empid }
        });                                                      //呼叫DBHelper的GetDataTable方法,查詢全部資料條件參數給null即可

        List <EWC_SignUpAtv> sList = new List <EWC_SignUpAtv>(); //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)                         //dt取回是object,要轉型成EWC_Activity型別
        {
            EWC_SignUpAtv s = new EWC_SignUpAtv()
            {                                              //dt.Rows是一個陣列
                ActivityID = row["ActivityID"].ToString(), //將欄位值(object)轉成EWC_SignUp型別
                EmployeeID = row["EmployeeID"].ToString(),
                Title      = row["Title"].ToString(),
                Type       = row["Type"].ToString(),
                StartDate  = row["StartDate"].ToString(),
                EndDate    = row["EndDate"].ToString(),
                StartTime  = row["StartTime"].ToString(),
                EndTime    = row["EndTime"].ToString(),
            };

            sList.Add(s);
        }

        return(sList);
    }
예제 #8
0
    //查詢單一活動
    public EWC_SignUp GetSignUp2(string ID)
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select * from EWC_ActivitySignUpDetail where ActivityID=@atvid",
                                                 new Dictionary <string, object> {
            { "@atvid", ID }
        });                                   //呼叫DBHelper的GetDataTable方法,查詢條件參數給活動ID

        EWC_SignUp signUp = new EWC_SignUp(); //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)      //dt取回是object,要轉型成EWC_Activity型別
        {
            signUp = new EWC_SignUp()
            {                                                                      //dt.Rows是一個陣列
                ActivitySignUpDetailID = row["ActivitySignUpDetailID"].ToString(), //將欄位值(object)轉成EWC_SignUp型別
                ActivityID             = row["ActivityID"].ToString(),
                EmployeeID             = row["EmployeeID"].ToString(),
                Name       = row["Name"].ToString(),
                IsEmployee = row["IsEmployee"].ToString(),
                TourBus    = row["TourBus"].ToString(),
            };

            //aList.Add(a);
        }

        return(signUp);
    }
예제 #9
0
 public void UpdateDefaultPhoto(string AlbumID, string DefaultPhoto)
 {
     EWC_DBHelper.RunTSQL("update EWC_Album set DefaultPhoto=@df where AlbumID=@abid",
                          new Dictionary <string, object> {
         { "@abid", AlbumID },
         { "@df", DefaultPhoto }
     });
 }
예제 #10
0
 public void Update(EWC_Photo p)
 {
     EWC_DBHelper.RunTSQL("update EWC_Photo set PhotoDesc=@pd where PhotoID=@pid",
                          new Dictionary <string, object> {
         { "@pid", p.PhotoID },
         { "@pd", p.PhotoDesc }
     });
 }
예제 #11
0
    //更新相片資訊
    public void Update(string p)
    {
        string[] ary = p.Split(',');

        EWC_DBHelper.RunTSQL("update EWC_Photo set PhotoDesc=@pd where PhotoID=@pid",
                             new Dictionary <string, object> {
            { "@pid", ary[0] },
            { "@pd", ary[1] }
        });
    }
예제 #12
0
 public void Insert(EWC_Photo p)
 {
     EWC_DBHelper.RunTSQL("insert into EWC_Photo values(@pid ,@abid, @fp, @pd)",
                          new Dictionary <string, object> {
         { "@pid", p.PhotoID },
         { "@abid", p.AlbumID },
         { "@fp", p.FilePath },
         { "@pd", p.PhotoDesc },
     });
 }
예제 #13
0
    public void Update(string a)
    {
        string [] ary = a.Split(',');

        EWC_DBHelper.RunTSQL("update EWC_Album set AlbumTitle=@abt,AlbumDesc=@abdesc where AlbumID=@abid",
                             new Dictionary <string, object> {
            { "@abid", ary[0] },
            { "@abt", ary[1] },
            { "@abdesc", ary[2] }
        });
    }
예제 #14
0
 public void Insert(EWC_Album a)
 {
     EWC_DBHelper.RunTSQL("insert into EWC_Album values(@abid ,@atid, @abtitle, @abdesc, @df)",
                          new Dictionary <string, object> {
         { "@abid", a.AlbumID },
         { "@atid", a.ActivityID },
         { "@abtitle", a.AlbumTitle },
         { "@abdesc", a.AlbumDesc },
         { "@df", a.DefaultPhoto }
     });
 }
예제 #15
0
 public void Insert(EWC_SignUp s)
 {
     EWC_DBHelper.RunTSQL("insert into EWC_ActivitySignUpDetail values(@suid ,@aid, @eid, @name, @ise , @tb)",
                          new Dictionary <string, object> {
         { "@suid", s.ActivitySignUpDetailID },
         { "@aid", s.ActivityID },
         { "@eid", s.EmployeeID },
         { "@name", s.Name },
         { "@ise", s.IsEmployee },
         { "@tb", s.TourBus }
     });
 }
예제 #16
0
    public List <EWC_Album> GetAlbum()
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select a.*, b.StartDate from EWC_Album as a join EWC_Activity as b on a.ActivityID = b.ActivityID order by StartDate DESC ", null); //呼叫DBHelper的GetDataTable方法,查詢全部資料條件參數給null即可

        List <EWC_Album> aList = new List <EWC_Album>();                                                                                                                              //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)                                                                                                                                              //dt取回是object,要轉型成EWC_Activity型別
        {
            EWC_Album a = new EWC_Album()
            {                                             //dt.Rows是一個陣列
                AlbumID      = row["AlbumID"].ToString(), //將欄位值(object)轉成EWC_Activity型別
                ActivityID   = row["ActivityID"].ToString(),
                AlbumTitle   = row["AlbumTitle"].ToString(),
                AlbumDesc    = row["AlbumDesc"].ToString(),
                DefaultPhoto = row["DefaultPhoto"].ToString(),
            };
            aList.Add(a);
        }
        return(aList);
    }
예제 #17
0
    //查詢所有活動
    public List <EWC_SignUpEmployee> GetSignUpEmployee()
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select a.*,b.Email,b.ext from EWC_ActivitySignUpDetail as a join AMS_Employee as b on a.EmployeeID = b.EmployeeID", null); //呼叫DBHelper的GetDataTable方法,查詢全部資料條件參數給null即可

        List <EWC_SignUpEmployee> sList = new List <EWC_SignUpEmployee>();                                                                                                   //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)                                                                                                                                     //dt取回是object,要轉型成EWC_Activity型別
        {
            EWC_SignUpEmployee s = new EWC_SignUpEmployee()
            {                                              //dt.Rows是一個陣列
                ActivityID = row["ActivityID"].ToString(), //將欄位值(object)轉成EWC_SignUp型別
                EmployeeID = row["EmployeeID"].ToString(),
                Name       = row["Name"].ToString(),
                Email      = row["Email"].ToString(),
                Ext        = row["Ext"].ToString(),
            };

            sList.Add(s);
        }

        return(sList);
    }
예제 #18
0
    //public List<EWC_Photo> GetPhoto()
    //{
    //    DataTable dt = EWC_DBHelper.GetDataTable("select * from EWC_Photo ORDER BY AlbumID DESC", null); //呼叫DBHelper的GetDataTable方法,查詢全部資料條件參數給null即可

    //    List<EWC_Photo> aList = new List<EWC_Photo>(); //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

    //    foreach (DataRow row in dt.Rows) //dt取回是object,要轉型成EWC_Activity型別
    //    {
    //        EWC_Photo p = new EWC_Photo()
    //        { //dt.Rows是一個陣列
    //            PhotoID = row["PhotoID"].ToString(), //將欄位值(object)轉成EWC_Activity型別
    //            AlbumID = row["AlbumID"].ToString(),
    //            FilePath = row["FilePath"].ToString(),
    //            PhotoDesc = row["PhotoDesc"].ToString(),
    //        };
    //        aList.Add(p);
    //    }
    //    return aList;
    //}

    public List <EWC_Photo> GetPhoto(string ID)
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select * from EWC_Photo where AlbumID=@abid",
                                                 new Dictionary <string, object> {
            { "@abid", ID }
        });                                              //呼叫DBHelper的GetDataTable方法,查詢條件參數給相簿ID

        List <EWC_Photo> aList = new List <EWC_Photo>(); //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)                 //dt取回是object,要轉型成EWC_Activity型別
        {
            EWC_Photo p = new EWC_Photo()
            {                                          //dt.Rows是一個陣列
                PhotoID   = row["PhotoID"].ToString(), //將欄位值(object)轉成EWC_Activity型別
                AlbumID   = row["AlbumID"].ToString(),
                FilePath  = row["FilePath"].ToString(),
                PhotoDesc = row["PhotoDesc"].ToString(),
            };
            aList.Add(p);
        }
        return(aList);
    }
예제 #19
0
    //查詢單一活動
    public EWC_Activity GetActivity2(string ID)
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select * from EWC_Activity where ActivityID=@atvid",
                                                 new Dictionary <string, object> {
            { "@atvid", ID }
        });                                    //呼叫DBHelper的GetDataTable方法,查詢條件參數給活動ID

        EWC_Activity atv = new EWC_Activity(); //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)       //dt取回是object,要轉型成EWC_Activity型別
        {
            atv = new EWC_Activity()
            {                                                       //dt.Rows是一個陣列
                ActivityID          = row["ActivityID"].ToString(), //將欄位值(object)轉成EWC_Activity型別
                Type                = row["Type"].ToString(),
                Title               = row["Title"].ToString(),
                Photo               = row["Photo"].ToString(),
                ActivityDescription = row["ActivityDescription"].ToString(),
                ActiveDate          = row["ActiveDate"].ToString(),
                StartDate           = row["StartDate"].ToString(),
                EndDate             = row["EndDate"].ToString(),
                StartTime           = row["StartTime"].ToString(),
                EndTime             = row["EndTime"].ToString(),
                Location            = row["Location"].ToString(),
                ActivitySchedule    = row["ActivitySchedule"].ToString(),
                AllowSignUp         = row["AllowSignUp"].ToString(),
                StartSignUpDate     = row["StartSignUpDate"].ToString(),
                EndSignUpDate       = row["EndSignUpDate"].ToString(),
                CompanyAmount       = row["CompanyAmount"].ToString(),
                Charge              = row["Charge"].ToString(),
                Bus  = row["Bus"].ToString(),
                Note = row["Note"].ToString()
            };

            //aList.Add(a);
        }

        return(atv);
    }
예제 #20
0
    //查詢所有活動
    public List <EWC_Activity> GetActivity()
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select * from EWC_Activity ORDER BY StartDate DESC", null); //呼叫DBHelper的GetDataTable方法,查詢全部資料條件參數給null即可

        List <EWC_Activity> aList = new List <EWC_Activity>();                                                //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)                                                                      //dt取回是object,要轉型成EWC_Activity型別
        {
            EWC_Activity a = new EWC_Activity()
            {                                                       //dt.Rows是一個陣列
                ActivityID          = row["ActivityID"].ToString(), //將欄位值(object)轉成EWC_Activity型別
                Type                = row["Type"].ToString(),
                Title               = row["Title"].ToString(),
                Photo               = row["Photo"].ToString(),
                ActivityDescription = row["ActivityDescription"].ToString(),
                ActiveDate          = row["ActiveDate"].ToString(),
                StartDate           = row["StartDate"].ToString(),
                EndDate             = row["EndDate"].ToString(),
                StartTime           = row["StartTime"].ToString(),
                EndTime             = row["EndTime"].ToString(),
                Location            = row["Location"].ToString(),
                ActivitySchedule    = row["ActivitySchedule"].ToString(),
                AllowSignUp         = row["AllowSignUp"].ToString(),
                StartSignUpDate     = row["StartSignUpDate"].ToString(),
                EndSignUpDate       = row["EndSignUpDate"].ToString(),
                CompanyAmount       = row["CompanyAmount"].ToString(),
                Charge              = row["Charge"].ToString(),
                Bus  = row["Bus"].ToString(),
                Note = row["Note"].ToString()
            };



            aList.Add(a);
        }

        return(aList);
    }
예제 #21
0
    //查詢所有活動
    public List <EWC_SignUp> GetSignUp()
    {
        DataTable dt = EWC_DBHelper.GetDataTable("select * from EWC_ActivitySignUpDetail ORDER BY ActivityID DESC", null); //呼叫DBHelper的GetDataTable方法,查詢全部資料條件參數給null即可

        List <EWC_SignUp> sList = new List <EWC_SignUp>();                                                                 //建立EWC_Activity型別的List,之後接GetDataTable回傳的EWC_Activity List

        foreach (DataRow row in dt.Rows)                                                                                   //dt取回是object,要轉型成EWC_Activity型別
        {
            EWC_SignUp s = new EWC_SignUp()
            {                                                                      //dt.Rows是一個陣列
                ActivitySignUpDetailID = row["ActivitySignUpDetailID"].ToString(), //將欄位值(object)轉成EWC_SignUp型別
                ActivityID             = row["ActivityID"].ToString(),
                EmployeeID             = row["EmployeeID"].ToString(),
                Name       = row["Name"].ToString(),
                IsEmployee = row["IsEmployee"].ToString(),
                TourBus    = row["TourBus"].ToString(),
            };

            sList.Add(s);
        }

        return(sList);
    }