Ejemplo n.º 1
0
 private void bt_Save_Click(object sender, EventArgs e)
 {
     using (cAaMISContext ctx = new cAaMISContext())
     {
         if (!(ctx.Setting.Any()))
         {
             var namess = new Setting
             {
                 ApproveBy = tb_ApproveBy.Text,
                 NotedBy   = tb_NotedBy.Text
             };
             ctx.Setting.Add(namess);
             ctx.SaveChanges();
         }
         else
         {
             var namess = ctx.Setting.First <Setting>();
             namess.setting_ID = 1;
             namess.ApproveBy  = tb_ApproveBy.Text;
             namess.NotedBy    = tb_NotedBy.Text;
             ctx.SaveChanges();
         }
     }
     MessageBox.Show("Report Settings Save Succesfully");
     this.Close();
 }
        private void SaveExternalReport()
        {
            using (cAaMISContext ctx = new cAaMISContext())
            {
                var externalReport = new ExternalRequest
                {
                    er_ID             = Convert.ToInt32(dgvr_ExternalRpt.Cells[0].Value.ToString()),
                    partyOrganization = tb_PartyOrganization.Text,
                    contactPerson     = tb_ContactPerson.Text,
                    contactNo         = tb_ContactNo.Text,
                    titleOfEvent      = tb_TitleOfEvent.Text,
                    dateOfEvent       = dtp_Date.Value,
                    timeOfEvent       = tb_Time.Text,
                    venueOfEvent      = tb_Venue.Text,
                    pd_Solo           = checkBox_Solo.Checked,
                    pd_Duet           = checkBox_Duet.Checked,
                    pd_Chorale        = checkBox_Chorale.Checked,
                    pd_RondallaBand   = checkBox_RondallaBand.Checked,
                    pd_FolkDance      = checkBox_FolkDance.Checked,
                    pd_HipHop         = checkBox_HipHop.Checked,
                    pd_Contemporary   = checkBox_Contemporary.Checked,
                    pd_DanceSports    = checkBox_DanceSports.Checked,
                    noOfPerformance   = tb_NoOfPerformance.Text,
                    noOfPerformer     = tb_NoOfPerformers.Text,
                    bitaw             = checkBox_BITAW.Checked,
                    specify           = tb_Specify.Text
                };

                // ctx.ExternalRequest.Attach(externalReport);
                ctx.Entry(externalReport).State = EntityState.Modified;
                ctx.SaveChanges();
            }
        }
Ejemplo n.º 3
0
        private void SaveExternalReport(bool value)
        {
            using (cAaMISContext ctx = new cAaMISContext())
            {
                var externalReport = new ExternalRequest
                {
                    partyOrganization = tb_PartyOrganization.Text,
                    contactPerson     = tb_ContactPerson.Text,
                    contactNo         = tb_ContactNo.Text,
                    titleOfEvent      = tb_TitleOfEvent.Text,
                    dateOfEvent       = dtp_Date.Value,
                    timeOfEvent       = tb_Time.Text,
                    venueOfEvent      = tb_Venue.Text,
                    pd_Solo           = checkBox_Solo.Checked,
                    pd_Duet           = checkBox_Duet.Checked,
                    pd_Chorale        = checkBox_Chorale.Checked,
                    pd_RondallaBand   = checkBox_RondallaBand.Checked,
                    pd_FolkDance      = checkBox_FolkDance.Checked,
                    pd_HipHop         = checkBox_HipHop.Checked,
                    pd_Contemporary   = checkBox_Contemporary.Checked,
                    pd_DanceSports    = checkBox_DanceSports.Checked,
                    noOfPerformance   = tb_NoOfPerformance.Text,
                    noOfPerformer     = tb_NoOfPerformers.Text,
                    bitaw             = checkBox_BITAW.Checked,
                    specify           = tb_Specify.Text,
                    ExternalInternal  = value
                };

                ctx.ExternalRequest.Add(externalReport);
                ctx.SaveChanges();
            }
        }
Ejemplo n.º 4
0
 private void LoadUserList()
 {
     using (cAaMISContext ctx = new cAaMISContext())
     {
         dataGridView_UserList.DataSource = ctx.UserAccount.Where(x => x.IsActive == true).ToList();
         customDesignDataGrid();
     }
 }
Ejemplo n.º 5
0
 private void SettingsForm_Load(object sender, EventArgs e)
 {
     using (cAaMISContext ctx = new cAaMISContext())
     {
         tb_ApproveBy.Text = ctx.Setting.Select(x => x.ApproveBy).Single();
         tb_NotedBy.Text   = ctx.Setting.Select(x => x.NotedBy).Single();
     }
 }
Ejemplo n.º 6
0
 private void LoadMemberList()
 {
     if (Choice == "Chorale")
     {
         label_Title.Text   = "Chorale Music";
         label_History.Text = "Chorale is the name of several related musical forms originating in the music genre of the Lutheran chorale: ... Such a tune presented in a homophonic or homorhythmic harmonisation, usually four-part harmony (e.g. Bach's four-part chorales, or the chorale included in the second movement of Mahler's Fifth Symphony)";
         using (cAaMISContext ctx = new cAaMISContext())
         {
             dataGridView_ListOfMembers.DataSource = ctx.StudentProfile.Where(x => x.Chorale == true).Select(p => new { p.Name }).ToList();
         }
     }
     else if (Choice == "Live")
     {
         label_Title.Text   = "Liveband Music";
         label_History.Text = "Original lead singer Ed Kowalczyk is sued for $2 million for continuing to use the band name after leaving the group in 2009. ... Each member of Live has an equal share of the company, according to a lawsuit filed in New York federal court. Kowalczyk left the band in 2009 as a new vocalist (Chris Shinn) came in.";
         using (cAaMISContext ctx = new cAaMISContext())
         {
             dataGridView_ListOfMembers.DataSource = ctx.StudentProfile.Where(x => x.LiveBand == true).Select(p => new { p.Name }).ToList();
         }
     }
     else if (Choice == "Rondalla")
     {
         label_Title.Text   = "Rondalla Music";
         label_History.Text = "The rondallah has its origins in the folk playing bands from Spain that were forerunners of the present-day rondallah and included four types: groups of young men who played and sang regularly in front of homes, bands of musicians known as murza or murga who begged for alms, a group of musicians known as comparza who played on stage, and groups of university musicians known as estudiantina, dubbed “tuna”. The usual musical instruments used by estudiantina members were mandolins, violins, guitars, flutes, cellos, basses, tambourines, castanets, and triangles. Estudiantina musicians in Spain and Mexico, before and during the age of musical romanticism, wore 16th century attire such as " + "short velvet breeches, ornate shirts and a short cape with multicolored ribbons.";
         using (cAaMISContext ctx = new cAaMISContext())
         {
             dataGridView_ListOfMembers.DataSource = ctx.StudentProfile.Where(x => x.RondallaBand == true).Select(p => new { p.Name }).ToList();
         }
     }
     else if (Choice == "Dance")
     {
         label_Title.Text   = "Folkdance/Hip Hop";
         label_History.Text = "First archeological proof of dance comes from the 9 thousand year old cave paintings in India.One of the earliest uses of structured dance was introduced in religious ceremonies that told the stories of ancient myths and gods. ... Modern dance history in Europe started with Renaissance, when many new dances were invented.";
         using (cAaMISContext ctx = new cAaMISContext())
         {
             dataGridView_ListOfMembers.DataSource = ctx.StudentProfile.Where(x => x.FolkDance == true || x.HipHop == true).Select(p => new { p.Name }).ToList();
         }
     }
     else if (Choice == "Theatre")
     {
         label_Title.Text   = "Theatre Arts";
         label_History.Text = "In fact, the history of theater can be traced back to 6th Century B.C. where the Ancient Greeks were the first to present dramatic presentations. One of the most popular forms of entertainment for people is a visit to the theater. For centuries people have enjoyed drama, comedy, music, and other forms of entertainment.";
         using (cAaMISContext ctx = new cAaMISContext())
         {
             dataGridView_ListOfMembers.DataSource = ctx.StudentProfile.Where(x => x.Theater == true).Select(p => new { p.Name }).ToList();
         }
     }
     else if (Choice == "Visual")
     {
         label_Title.Text   = "Visual Arts";
         label_History.Text = "The Baroque started after the Renaissance, from the late 16th century to the late 17th century. Main artists of the Baroque included Caravaggio, who made heavy use of tenebrism.";
         using (cAaMISContext ctx = new cAaMISContext())
         {
             dataGridView_ListOfMembers.DataSource = ctx.StudentProfile.Where(x => x.PaintingDrawing == true || x.MakeUp == true || x.Photography == true || x.Multimedia == true).Select(p => new { p.Name }).ToList();
         }
     }
 }
 private void ucYearListofEvents_Load(object sender, EventArgs e)
 {
     using (cAaMISContext ctx = new cAaMISContext())
     {
         dataGridView_ListOfEvents.DataSource = ctx.YearListOfEvents.ToList();
     }
     this.dataGridView_ListOfEvents.Columns["yearListOfEvents_ID"].Visible = false;
     this.dataGridView_ListOfEvents.Columns["DescriptionEvent"].HeaderText = "Event Desciption";
     this.dataGridView_ListOfEvents.Columns["DateEvent"].HeaderText        = "Date of Event";
 }
Ejemplo n.º 8
0
        private void bt_SaveStudentProfile_Click(object sender, EventArgs e)
        {
            try
            {
                using (cAaMISContext ctx = new cAaMISContext())
                {
                    var studentProfile = new StudentProfile
                    {
                        //Part 1
                        Name          = tb_Name.Text,
                        NickName      = tb_NickName.Text,
                        Course        = tb_Course.Text,
                        Year          = tb_Year.Text,
                        CellphoneNo   = tb_CellphoneNo.Text,
                        EmailAddress  = tb_EmaillAddress.Text,
                        BirthDate     = dateTimePicker_BirthDate.Value.Date,
                        Age           = Convert.ToInt32(tb_Age.Text),
                        HomeAddress   = tb_HomeAddress.Text,
                        CampusAddress = tb_CampusAddress.Text,

                        //Part 2
                        HavePerformed  = cb_HavePerformed.Checked,
                        HaveTrainings  = cb_HaveTraining.Checked,
                        HaveExperience = cb_HaveTraining.Checked,
                        CanAttend      = cb_CanAttend.Checked,
                        Commuter       = cb_Commuter.Checked,
                        Skills         = tb_Skills.Text,
                        Finance        = tb_Finance.Text,

                        //Part 3
                        FolkDance           = cb_FolkDance.Checked,
                        HipHop              = cb_HipHop.Checked,
                        Contemporary        = cb_Contemporary.Checked,
                        Theater             = cb_Theater.Checked,
                        LiteraryArts        = cb_LiteraryArts.Checked,
                        RadioTalents        = cb_RadioTalents.Checked,
                        ManagementTechnical = cb_ManagementTechnical.Checked,
                        Chorale             = cb_Chorale.Checked,
                        LiveBand            = cb_LiveBand.Checked,
                        RondallaBand        = cb_RondallaBand.Checked,
                        PaintingDrawing     = cb_PaintingDrawing.Checked,
                        MakeUp              = cb_MakeUp.Checked,
                        Photography         = cb_Photography.Checked,
                        Multimedia          = cb_Multimedia.Checked,
                    };
                    ctx.StudentProfile.Add(studentProfile);
                    ctx.SaveChanges();
                    MessageBox.Show("Student Profile Save Successfully");
                    ClearText();
                }
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 9
0
        private void bt_Save_Click(object sender, EventArgs e)
        {
            string test = cb_Role.SelectedIndex.ToString();

            if (tb_Password.Text == tb_ReTypePassword.Text && !(string.IsNullOrEmpty(tb_Username.Text)))
            {
                if ((string.IsNullOrEmpty(tempId_UserList)))
                {
                    using (cAaMISContext ctx = new cAaMISContext())
                    {
                        var userAccount = new UserAccount
                        {
                            UserName   = tb_Username.Text,
                            Password   = tb_Password.Text,
                            FirstName  = tb_FirstName.Text,
                            MiddleName = tb_MiddleName.Text,
                            LastName   = tb_LastName.Text,
                            IsActive   = true,
                            Role       = cb_Role.SelectedIndex.ToString()
                        };
                        ctx.UserAccount.Add(userAccount);
                        ctx.SaveChanges();
                        LoadUserList();
                        MessageBox.Show("User Added Succesfully");
                        ClearText();
                    }
                }
                else
                {
                    using (cAaMISContext ctx = new cAaMISContext())
                    {
                        int         tempId      = Convert.ToInt32(tempId_UserList);
                        UserAccount userAccount = ctx.UserAccount.Where(x => x.ua_ID == tempId).FirstOrDefault();
                        userAccount.UserName   = tb_Username.Text;
                        userAccount.Password   = tb_Password.Text;
                        userAccount.FirstName  = tb_FirstName.Text;
                        userAccount.MiddleName = tb_MiddleName.Text;
                        userAccount.LastName   = tb_LastName.Text;
                        userAccount.IsActive   = Convert.ToBoolean(dataGridView_UserList.SelectedRows[0].Cells[6].Value.ToString());
                        userAccount.Role       = cb_Role.SelectedIndex.ToString();
                        ctx.SaveChanges();
                        LoadUserList();
                        MessageBox.Show("Update Successfully");
                        ClearText();
                    }
                }
            }
            else
            {
                MessageBox.Show("Dont leave blank the fields");
            }
        }
Ejemplo n.º 10
0
        private void bt_AddEvent_Click(object sender, EventArgs e)
        {
            using (cAaMISContext ctx = new cAaMISContext())
            {
                var events = new YearListOfEvents
                {
                    DescriptionEvent = tb_DescriptionEvent.Text,
                    DateEvent        = dateTimePicker_DateEvent.Value.Date
                };

                ctx.YearListOfEvents.Add(events);
                ctx.SaveChanges();
                MessageBox.Show("Event Added Succesfully");
                ClearText();
            }
        }
Ejemplo n.º 11
0
        private void tb_Deny_Click(object sender, EventArgs e)
        {
            using (cAaMISContext ctx = new cAaMISContext())
            {
                var denied = ctx.ExternalRequest.First <ExternalRequest>();

                denied.er_ID         = Convert.ToInt32(dataGridView_ListOfRequest.SelectedRows[0].Cells[0].Value.ToString());
                denied.denied_Reason = tb_DeniedReason.Text;
                denied.denied        = true;
                denied.granted       = false;

                ctx.SaveChanges();
            }
            LoadListRequest();
            MessageBoxNotify("Denied");
        }
Ejemplo n.º 12
0
        private void bt_Granted_Click(object sender, EventArgs e)
        {
            using (cAaMISContext ctx = new cAaMISContext())
            {
                var granted = ctx.ExternalRequest.First <ExternalRequest>();

                granted.er_ID      = Convert.ToInt32(dataGridView_ListOfRequest.SelectedRows[0].Cells[0].Value.ToString());
                granted.ApprovedBy = ctx.Setting.Select(x => x.ApproveBy).Single();
                granted.notedBy    = ctx.Setting.Select(x => x.NotedBy).Single();
                granted.granted    = true;
                granted.denied     = false;

                ctx.SaveChanges();
            }
            LoadListRequest();
            MessageBoxNotify("Granted");
        }
        private void bt_Search_Click(object sender, EventArgs e)
        {
            using (cAaMISContext ctx = new cAaMISContext())
            {
                dataGridView_ListStudentProfile.DataSource = ctx.StudentProfile.Select
                                                                 (p => new {
                    //Part 1
                    p.studentProfile_ID,
                    p.Name,
                    p.NickName,
                    p.Course,
                    p.Year,
                    p.CellphoneNo,
                    p.EmailAddress,
                    p.BirthDate,
                    p.Age,
                    p.HomeAddress,
                    p.CampusAddress,
                    //Part 2
                    p.HavePerformed,
                    p.HaveTrainings,
                    p.HaveExperience,
                    p.CanAttend,
                    p.Commuter,
                    p.Skills,
                    p.Finance,
                    //Part 3
                    p.FolkDance,
                    p.HipHop,
                    p.Contemporary,
                    p.Theater,
                    p.LiteraryArts,
                    p.RadioTalents,
                    p.ManagementTechnical,
                    p.Chorale,
                    p.LiveBand,
                    p.RondallaBand,
                    p.PaintingDrawing,
                    p.MakeUp,
                    p.Photography,
                    p.Multimedia
                }).ToList();
            }

            this.dataGridView_ListStudentProfile.Columns["studentProfile_ID"].Visible = false;
            this.dataGridView_ListStudentProfile.Columns["NickName"].Visible          = false;
            this.dataGridView_ListStudentProfile.Columns["Course"].Visible            = false;
            this.dataGridView_ListStudentProfile.Columns["Year"].Visible          = false;
            this.dataGridView_ListStudentProfile.Columns["CellphoneNo"].Visible   = false;
            this.dataGridView_ListStudentProfile.Columns["EmailAddress"].Visible  = false;
            this.dataGridView_ListStudentProfile.Columns["BirthDate"].Visible     = false;
            this.dataGridView_ListStudentProfile.Columns["Age"].Visible           = false;
            this.dataGridView_ListStudentProfile.Columns["HomeAddress"].Visible   = false;
            this.dataGridView_ListStudentProfile.Columns["CampusAddress"].Visible = false;

            this.dataGridView_ListStudentProfile.Columns["HavePerformed"].Visible  = false;
            this.dataGridView_ListStudentProfile.Columns["HaveTrainings"].Visible  = false;
            this.dataGridView_ListStudentProfile.Columns["HaveExperience"].Visible = false;
            this.dataGridView_ListStudentProfile.Columns["CanAttend"].Visible      = false;
            this.dataGridView_ListStudentProfile.Columns["Commuter"].Visible       = false;
            this.dataGridView_ListStudentProfile.Columns["Skills"].Visible         = false;
            this.dataGridView_ListStudentProfile.Columns["Finance"].Visible        = false;

            this.dataGridView_ListStudentProfile.Columns["FolkDance"].Visible           = false;
            this.dataGridView_ListStudentProfile.Columns["HipHop"].Visible              = false;
            this.dataGridView_ListStudentProfile.Columns["Contemporary"].Visible        = false;
            this.dataGridView_ListStudentProfile.Columns["Theater"].Visible             = false;
            this.dataGridView_ListStudentProfile.Columns["LiteraryArts"].Visible        = false;
            this.dataGridView_ListStudentProfile.Columns["RadioTalents"].Visible        = false;
            this.dataGridView_ListStudentProfile.Columns["ManagementTechnical"].Visible = false;
            this.dataGridView_ListStudentProfile.Columns["Chorale"].Visible             = false;
            this.dataGridView_ListStudentProfile.Columns["LiveBand"].Visible            = false;
            this.dataGridView_ListStudentProfile.Columns["RondallaBand"].Visible        = false;
            this.dataGridView_ListStudentProfile.Columns["PaintingDrawing"].Visible     = false;
            this.dataGridView_ListStudentProfile.Columns["MakeUp"].Visible              = false;
            this.dataGridView_ListStudentProfile.Columns["Photography"].Visible         = false;
            this.dataGridView_ListStudentProfile.Columns["Multimedia"].Visible          = false;

            this.dataGridView_ListStudentProfile.Columns["Name"].HeaderText = "Name";
        }