예제 #1
0
        protected void GridBackOfficeContactView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            string id = e.Keys[0].ToString();

            controller.DeleteBackOfficeContact(id);

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

            Bind();
        }
예제 #2
0
        protected void GridBackOfficeContactView_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            BackOfficeContactViewModel model = new BackOfficeContactViewModel();

            model.Address     = e.NewValues["Address"].ToString() ?? string.Empty;
            model.City        = e.NewValues["City"].ToString() ?? string.Empty;
            model.CompanyName = e.NewValues["CompanyName"].ToString() ?? string.Empty;
            model.Country     = e.NewValues["Country"].ToString() ?? string.Empty;
            model.Email       = e.NewValues["Email"].ToString() ?? string.Empty;
            model.FirstName   = e.NewValues["FirstName"].ToString() ?? string.Empty;
            model.LastName    = e.NewValues["LastName"].ToString() ?? string.Empty;

            controller.AddBackOfficeContact(model);

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

            Bind();
        }
예제 #3
0
        protected void GridBackOfficeContactView_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            List <BackOfficeContactViewModel> list = (List <BackOfficeContactViewModel>)GridBackOfficeContactView.DataSource;
            var model = list.Find(m => m.Id == e.Keys[0].ToString());

            model.Address     = e.NewValues["Address"].ToString() ?? string.Empty;
            model.City        = e.NewValues["City"].ToString() ?? string.Empty;
            model.CompanyName = e.NewValues["CompanyName"].ToString() ?? string.Empty;
            model.Country     = e.NewValues["Country"].ToString() ?? string.Empty;
            model.Email       = e.NewValues["Email"].ToString() ?? string.Empty;
            model.FirstName   = e.NewValues["FirstName"].ToString() ?? string.Empty;
            model.LastName    = e.NewValues["LastName"].ToString() ?? string.Empty;

            controller.UpdateBackOfficeContact(model);

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

            Bind();
        }