Exemplo n.º 1
0
        protected void GridB2BCustomerView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            string id = e.Keys[0].ToString();

            controller.Delete(id);

            e.Cancel = true;
            GridB2BCustomerView.CancelEdit();

            Bind();
        }
Exemplo n.º 2
0
        protected void GridB2BCustomerView_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            CoreViewModel model = new CoreViewModel();

            model.Address = e.NewValues["Address"].ToString();
            model.Bank    = e.NewValues["Bank"].ToString();
            model.City    = e.NewValues["City"].ToString();
            model.Country = e.NewValues["Country"].ToString();
            model.IBAN    = e.NewValues["IBAN"].ToString();
            model.Name    = e.NewValues["Name"].ToString();
            model.PersonalIdentificationNumber = e.NewValues["PersonalIdentificationNumber"].ToString();
            model.ProviderId = (int)e.NewValues["ProviderId"];
            controller.Add(model);

            e.Cancel = true;
            GridB2BCustomerView.CancelEdit();

            Bind();
        }
Exemplo n.º 3
0
        protected void GridB2BCustomerView_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            var           list  = (List <CoreViewModel>)GridB2BCustomerView.DataSource;
            CoreViewModel model = list.Find(m => m.Id == e.Keys[0].ToString());

            model.Address = e.NewValues["Address"].ToString();
            model.Bank    = e.NewValues["Bank"].ToString();
            model.City    = e.NewValues["City"].ToString();
            model.Country = e.NewValues["Country"].ToString();
            model.IBAN    = e.NewValues["IBAN"].ToString();
            model.Name    = e.NewValues["Name"].ToString();
            model.PersonalIdentificationNumber = e.NewValues["PersonalIdentificationNumber"].ToString();
            model.ProviderId = (int)e.NewValues["ProviderId"];
            controller.Update(model);

            e.Cancel = true;
            GridB2BCustomerView.CancelEdit();

            Bind();
        }