Пример #1
0
        public static void UpdateGroup(GroupInfo groupInfo)
        {
            var grp = GetGroup(groupInfo);

            grp.Name = groupInfo.Name;
            GroupDAL.UpdateGroup(grp);
        }
Пример #2
0
 private void dataGridViewGroups_CellEndEdit(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         //at the momment we can only edit "Description" column
         GroupDAL.UpdateGroup((int)dataGridViewGroups.Rows[dataGridViewGroups.SelectedCells[0].RowIndex].Cells["Group ID"].Value,
                              dataGridViewGroups.Rows[dataGridViewGroups.SelectedCells[0].RowIndex].Cells["Description"].Value.ToString());
         MessageBox.Show("Changes successfully saved!");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #3
0
    // To pass 'Group' data in GroupDAL Data Access Layer for updation
    public int UpdateGroup(int GroupId, string GroupDescription, bool IsActive, string GroupName, int LoginUser, string Ret)
    {
        GroupDAL GroupDAL = new GroupDAL();

        try
        {
            return(GroupDAL.UpdateGroup(GroupId, GroupDescription, IsActive, GroupName, LoginUser, Ret));
        }
        catch
        {
            throw;
        }
        finally
        {
            GroupDAL = null;
        }
    }
Пример #4
0
        private void saveGroups()
        {
            SchoolJournalEntities context = new SchoolJournalEntities();
            var groupIDs = from g in context.Groups select g.GroupID;

            try
            {
                foreach (DataGridViewRow r in GroupsDataGridView.Rows)
                {
                    if (r.IsNewRow)
                    {
                        continue;
                    }
                    int groupID = int.Parse(GroupsDataGridView["GroupID", r.Index].Value.ToString());
                    if (groupIDs.Contains(groupID)) //update
                    {
                        GroupDAL.UpdateGroup(groupID,
                                             int.Parse(GroupsDataGridView["TeacherID", r.Index].Value.ToString()),
                                             GroupsDataGridView["Subject", r.Index].EditedFormattedValue.ToString(),
                                             GroupsDataGridView["Grade", r.Index].EditedFormattedValue.ToString(),
                                             GroupsDataGridView["Description", r.Index].Value.ToString());
                    }
                    else //add new
                    {
                        GroupsDataGridView["GroupID", r.Index].Value =
                            GroupDAL.NewGroup(int.Parse(GroupsDataGridView["TeacherID", r.Index].Value.ToString()),
                                              GroupsDataGridView["Subject", r.Index].EditedFormattedValue.ToString(),
                                              GroupsDataGridView["Grade", r.Index].EditedFormattedValue.ToString(),
                                              GroupsDataGridView["Description", r.Index].Value.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                context.Dispose();
            }
        }
Пример #5
0
 // To pass 'Group' data in GroupDAL Data Access Layer for updation
 public int UpdateGroup(int GroupId,string GroupDescription, bool IsActive, string GroupName, int LoginUser, string Ret)
 {
     GroupDAL GroupDAL = new GroupDAL();
     try
     {
         return GroupDAL.UpdateGroup(GroupId, GroupDescription,IsActive, GroupName, LoginUser, Ret);
     }
     catch
     {
         throw;
     }
     finally
     {
         GroupDAL = null;
     }
 }
Пример #6
0
 internal int UpdateGroup(Inv_ProductGroup groupObj, int groupId)
 {
     return(groupDal.UpdateGroup(groupId, groupObj));
 }
Пример #7
0
 public static void UpdateGroup(string ID, string GroupName, int leadID)
 {
     GroupDAL.UpdateGroup(GroupName, leadID, int.Parse(ID));
 }