コード例 #1
0
ファイル: TouristSiteView.aspx.cs プロジェクト: ibudisa/IDOM
        protected void GridTouristSiteView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            string id = e.Keys[0].ToString();

            controller.DeleteTouristSite(id);
            e.Cancel = true;
            GridTouristSiteView.CancelEdit();

            Bind();
        }
コード例 #2
0
ファイル: TouristSiteView.aspx.cs プロジェクト: ibudisa/IDOM
        protected void GridTouristSiteView_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            TouristSiteViewModel model = new TouristSiteViewModel();

            model.CountryId   = e.NewValues["CountryId"] == null? 0:(int)e.NewValues["CountryId"];
            model.Description = e.NewValues["Description"].ToString() ?? string.Empty;
            model.PlaceId     = e.NewValues["PlaceId"] == null ? 0 : (int)e.NewValues["PlaceId"];
            model.RegionId    = e.NewValues["RegionId"] == null ? 0 : (int)e.NewValues["RegionId"];
            model.SiteCode    = e.NewValues["SiteCode"].ToString() ?? string.Empty;
            model.SiteName    = e.NewValues["SiteName"].ToString() ?? string.Empty;
            model.Stars       = e.NewValues["Stars"] == null ? 0 : (int)e.NewValues["Stars"];
            //model.ImageGalleryPath = e.NewValues["ImageGalleryPath"].ToString()?? string.Empty;
            //model.ImageThumbnailsPath = e.NewValues["ImageThumbnailsPath"].ToString()?? string.Empty;

            controller.AddTouristSite(model);
            e.Cancel = true;
            GridTouristSiteView.CancelEdit();

            Bind();
        }
コード例 #3
0
ファイル: TouristSiteView.aspx.cs プロジェクト: ibudisa/IDOM
        protected void GridTouristSiteView_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            var listSaP = (List <TouristSiteViewModel>)GridTouristSiteView.DataSource;
            TouristSiteViewModel model = listSaP.Find(m => m.id == e.Keys[0].ToString());

            model.CountryId   = e.NewValues["CountryId"] == null ? 0 : (int)e.NewValues["CountryId"];
            model.Description = e.NewValues["Description"].ToString() ?? string.Empty;
            model.PlaceId     = e.NewValues["PlaceId"] == null ? 0 : (int)e.NewValues["PlaceId"];
            model.RegionId    = e.NewValues["RegionId"] == null ? 0 : (int)e.NewValues["RegionId"];
            model.SiteCode    = e.NewValues["SiteCode"].ToString() ?? string.Empty;
            model.SiteName    = e.NewValues["SiteName"].ToString() ?? string.Empty;
            model.Stars       = e.NewValues["Stars"] == null ? 0 : (int)e.NewValues["Stars"];
            //model.ImageGalleryPath = e.NewValues["ImageGalleryPath"].ToString() ?? string.Empty;
            //model.ImageThumbnailsPath = e.NewValues["ImageThumbnailsPath"].ToString() ?? string.Empty;

            controller.UpdateTouristSite(model);
            e.Cancel = true;
            GridTouristSiteView.CancelEdit();

            Bind();
        }