Exemplo n.º 1
0
 protected override void AfterChange(DataColumn dc, DataRow row)
 {
     officeDB.ContactEmailRow dr = (officeDB.ContactEmailRow)row;
     switch (dc.ColumnName)
     {
     case "Email":
     case "Main":
         if (dr.Main)
         {
             dr.OfficerRow.EmailAddress = dr.Email;
         }
         foreach (officeDB.ContactEmailRow cr in dr.OfficerRow.GetContactEmailRows())
         {
             if (dr.Id != cr.Id & cr.Main)
             {
                 cr.Main = false;
             }
         }
         break;
     }
 }
Exemplo n.º 2
0
        protected override void AfterAdd(DataRow row)
        {
            officeDB.ContactEmailRow dr = (officeDB.ContactEmailRow)row;
            string ObjectName           = this.myDT.TableName;

            dr.Id = this.myA.AtMng.PKIDGet(ObjectName, 1);

            if (dr.OfficerRow != null)
            {
                //if (dr.OfficerRow.GetContactEmailRows().Length == 1)
                //    dr.Main = true;
                //else
                dr.Main = false;

                dr.DisplayName = dr.OfficerRow.FirstName + " " + dr.OfficerRow.LastName;
            }
            else
            {
                dr.Main = false;
            }
        }