Beispiel #1
0
 void frm_LoadInMainWindow(int option, string tranid,bool usecon,string con)
 {
     //var f = new ItemMove();
     //f.Show();
     if (option == 0)
     {
         ItemMove frm = null;
         if ((frm = (ItemMove)IsFormAlreadyOpen(typeof(ItemMove))) == null)
         {
             frm = new ItemMove();
             frm.OtherStore = usecon;
             frm.MdiParent = this;
            
             frm.Show();
             if (!string.IsNullOrEmpty(tranid))
             {
               frm._tranid = tranid;
               frm.DoView(true,usecon,con); 
             }
         }
         else
         {
             frm.Select();
         }
     }
     opentab = 2;
 }
 private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
 {
  
     foreach (DsPurchase.PURCHASEREQUESTRow dr in dsPurchase1.PURCHASEREQUEST)
     {
         if (!dr.IsISSUEDNull())
         {
             if (dr.ISSUED > 0)
             {
                 dr.UPLOAD = true;
                 dr.INORDER = true;
             }
         }
     }
     var dm = new PrDataManager { Purchaserequest = dsPurchase1.PURCHASEREQUEST };
     var changes = (DsPurchase.PURCHASEREQUESTDataTable)dsPurchase1.PURCHASEREQUEST.GetChanges();
     var retval = dm.DoSave();
     if (retval == "1")
     {
         var addedRows = from row in dsPurchase1.PURCHASEREQUEST
                         where row.RowState == DataRowState.Added
                         select row;
         foreach (var row in addedRows.ToArray())
         {
             row.Delete();
         }
         if (changes != null) dsPurchase1.Merge(changes);
         dsPurchase1.AcceptChanges();
     }
     dsPurchase1.Merge(new PrDataManager().GetPurchaseRequestList(lookupfrom.EditValue.ToString()));
     var f = new ItemMove();
     gridView1.PostEditor();
     gridView1.UpdateCurrentRow();
     f.CreateItemMoveFrmPr(dsPurchase1.PURCHASEREQUEST, lookupfrom.EditValue.ToString());
     f.Show();
 }