Beispiel #1
0
        /// <summary>
        /// Add new item
        /// </summary>
        public override void Add()
        {
            Domain.Region r = ClientEnvironment.RegionService.CreateEntity();
            r.LanguageID = ClientEnvironment.LanguageId;

            using (RegionFrm frm = new RegionFrm())
            {
                frm.Entity = r;
                if (frm.ShowDialog(this) == DialogResult.OK && frm.Modified)
                {
                    if (r.IsNew)
                        ClientEnvironment.RegionService.Save(r);
                    else
                        ClientEnvironment.RegionService.SaveOrUpdate(r);
                    RefreshData();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Add new item
        /// </summary>
        public override void Add()
        {
            Domain.Region r = ClientEnvironment.RegionService.CreateEntity();
            r.LanguageID = ClientEnvironment.LanguageId;

            using (RegionFrm frm = new RegionFrm())
            {
                frm.Entity = r;
                if (frm.ShowDialog(this) == DialogResult.OK && frm.Modified)
                {
                    if (r.IsNew)
                    {
                        ClientEnvironment.RegionService.Save(r);
                    }
                    else
                    {
                        ClientEnvironment.RegionService.SaveOrUpdate(r);
                    }
                    RefreshData();
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Edit current item
 /// </summary>
 public override void Edit()
 {
     Domain.Region r = (Domain.Region)mainGridView.GetRow(mainGridView.FocusedRowHandle);
     if (r != null)
     {
         using (RegionFrm frm = new RegionFrm())
         {
             frm.Entity = r;
             if (frm.ShowDialog(this) == DialogResult.OK && frm.Modified)
             {
                 if (r.IsNew)
                 {
                     ClientEnvironment.RegionService.Save(r);
                 }
                 else
                 {
                     ClientEnvironment.RegionService.SaveOrUpdate(r);
                 }
                 RefreshData();
             }
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// Edit current item
 /// </summary>
 public override void Edit()
 {
     Domain.Region r = (Domain.Region)mainGridView.GetRow(mainGridView.FocusedRowHandle);
     if (r != null)
     {
         using (RegionFrm frm = new RegionFrm())
         {
             frm.Entity = r;
             if (frm.ShowDialog(this) == DialogResult.OK && frm.Modified)
             {
                 if (r.IsNew)
                     ClientEnvironment.RegionService.Save(r);
                 else
                     ClientEnvironment.RegionService.SaveOrUpdate(r);
                 RefreshData();
             }
         }
     }
 }