Exemple #1
0
 private void editOrg()
 {
     if (!App.AllowOrgDirChange)
     {
         return;
     }
     if (this.dataView1.Count > 0)
     {
         BindingManagerBase bm = (BindingManagerBase)this.BindingContext[this.dataView1];
         BLL.Orgs.DataSets.dsOrgs.OrgsRow rw = (BLL.Orgs.DataSets.dsOrgs.OrgsRow)((DataRowView)bm.Current).Row;
         EditOrgs eo = new EditOrgs(rw);
         eo.ShowDialog();
         if (eo.DialogResult == DialogResult.OK)
         {
             if (!bllOrgs.Update())
             {
                 bllOrgs.DataSet.RejectChanges();
             }
         }
     }
 }
Exemple #2
0
        private void addOrg()
        {
            if (!App.AllowOrgDirChange)
            {
                return;
            }
            int nOrgID = EditOrgs.AddOrgDialog(App.bllOrgs, "", "");

            if (nOrgID > 0)
            {
//				int ix = this.dataView1.Find(nOrgID);
                for (int i = 0; i < this.dataView1.Count; i++)
                {
                    if (Convert.ToInt32(this.dataView1[i]["OrgID"]) == nOrgID)
                    {
                        this.BindingContext[this.dataView1].Position = i;
                        break;
                    }
                }
            }
        }