public void Remove(PopupUserObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(PopupUserObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Called by PopupUserObject when it changes
 internal void PopupUserObjectChanged(PopupUserObject popupUser)
 {
     try
     {
         int index = List.IndexOf(popupUser);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         PopupUserObject popupUser = new PopupUserObject();
         List.Add(popupUser);
         return(popupUser);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         PopupUserObject popupUser = (PopupUserObject)value;
         popupUser.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    PopupUserObject oldpopupUser = (PopupUserObject)oldValue;
                    PopupUserObject newpopupUser = (PopupUserObject)newValue;
                    oldpopupUser.Parent = null;
                    newpopupUser.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Esempio n. 7
0
 public static PopupUserObject TaskPeopleRowToObject(DataRow popupUser)
 {
     PopupUserObject obj = new PopupUserObject();
     try
     {
         if (popupUser != null)
         {
             obj.User = User.UserConvertor.UserRowToObject(popupUser);
             obj.Popup = Popup.PopupConvertor.PopupRowToObject(popupUser);
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
Esempio n. 8
0
        public static PopupUserObject TaskPeopleRowToObject(DataRow popupUser)
        {
            PopupUserObject obj = new PopupUserObject();

            try
            {
                if (popupUser != null)
                {
                    obj.User  = User.UserConvertor.UserRowToObject(popupUser);
                    obj.Popup = Popup.PopupConvertor.PopupRowToObject(popupUser);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
 // Called by PopupUserObject when it changes
 internal void PopupUserObjectChanged(PopupUserObject popupUser)
 {
     try
     {
         int index = List.IndexOf(popupUser);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(PopupUserObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         PopupUserObject popupUser = new PopupUserObject();
         List.Add(popupUser);
         return popupUser;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(PopupUserObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Esempio n. 13
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                _popup.Description = memoDescription.Text;
                _popup.Active = cbxActive.Checked;
                _popup.CreationDate = PROF_IT.Common.Convert.DateFunctions.DateToStrDate(dteStartDate.DateTime);
                _popup.Repeation = (Enumeration.Frequency.TimeFrequency)cmbFrequency.EditValue;
                if (txtTimeOfDay.Text.Length == 7)
                    _popup.Time = "0" + txtTimeOfDay.Text.Replace(":", "");
                else
                    _popup.Time = txtTimeOfDay.Text.Replace(":", "");
                //Save parent to have the correct GUID ID
                new BL.Internal.Popup().Save(PopupMember);

                //Link Popup to all users
                UserObjectCollection users = new BL.Internal.User().GetAll();
                foreach (UserObject user in users)
                {
                    PopupUserObject popupUser = new PopupUserObject();
                    popupUser.Popup = _popup;
                    popupUser.State = PROF_IT.Common.Enumerations.ObjectState.Created;
                    popupUser.User = user;
                    _popup.PopupUsers.Add(popupUser);
                }

                //Save Parent with childs
                new BL.Internal.Popup().Save(PopupMember);

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
            catch (System.Exception exception1)
            {
                System.Exception thisException = exception1;
                Management.ShowException(thisException);
            }
        }
Esempio n. 14
0
 public void Save(PopupUserObject popupUser)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "PopupUser_Save",
             CreateParameter("@popupuserID", SqlDbType.UniqueIdentifier, popupUser.PopupUserID, ParameterDirection.InputOutput),
             CreateParameter("@popupID", SqlDbType.UniqueIdentifier, popupUser.Popup.PopupID),
             CreateParameter("@userID", SqlDbType.UniqueIdentifier, popupUser.User == null ? Guid.Empty : popupUser.User.UsrID)
             );
         popupUser.PopupUserID = (Guid)cmd.Parameters["@popupuserID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
Esempio n. 15
0
 public bool Remove(PopupUserObject popupUser)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "PopupUser_DELETE",
             CreateParameter("@popupuserID", SqlDbType.UniqueIdentifier, popupUser.PopupUserID, ParameterDirection.Input)
             );
         return true;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }