Exemple #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();
                }
            }
        }
Exemple #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();
                }
            }
        }
Exemple #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();
             }
         }
     }
 }
Exemple #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();
             }
         }
     }
 }