none
Update In MVVM

    Question

  • hi

     This is My Code :

    private ObservableCollection<Company> _Companes; 
    
    //bind with ItemSource DataGrid 
    
    public ObservableCollection<Company> Companes 
    
    { get { return _Companes; } set { _Companes = value; NotifyPropertyChanged("Companes"); } }
    
     //Bind SelectedItem DataGrid
    
     private Company _company;
    
     public Company company { get { return _company; } set { _company = value; NotifyPropertyChanged("company"); } }
    
     //Add Method
    
     public void AddCompanys() 
    
    { IsBusy = true; 
    
    Company co = new Company(); 
    
    co.CompanyID = CompanyID; 
    
    co.CompanyLU = CompanyLU; 
    
    co.CompanyName = CompanyName; 
    
    co.CompanyParentID1 = CompanyParentID1;
    
     co.CompanySerialNumber = CompanySerialNumber; 
    
    co.driverLU = driverLU; co.FuelDef = FuelDef;
    
     co.MaxSpeed = MaxSpeed;
    
     co.MissionLU = MissionLU; 
    
    co.TrackingInterval = TrackingInterval;
    
     co.VCheckLU = VCheckLU; 
    
    co.VehicleLU = VehicleLU;
    
     co.VGLU = VGLU;
    
     co.VOilReqLU = VOilReqLU; 
    
    DB.Companies.Add(co); 
    
    DB.SubmitChanges(OnChanged, null);
    
     } 
    
    //Delete Method
    
     public void DeleteCompany() 
    
    { if (company != null) 
    
    { IsBusy = true; DB.Companies.Remove(company);
    
     DB.SubmitChanges(OnChanged, null); } }
    

     Please Write For me Update method

    Wednesday, November 23, 2011 4:29 AM

Answers

All replies