예제 #1
0
        protected override int SaveItem()
        {
            int photoId = GetId();

            d.Photo photo = new d.Photo(photoId);
            photo.ExternalReference = tbxNumber.Text.Trim();
            photo.Gender            = ddlGender.SelectedValue;
            photo.RaceId            = Convert.ToInt32(ddlRace.SelectedValue);
            photo.HairColorId       = Convert.ToInt32(ddlHairColor.SelectedValue);
            photo.AgeRangeId        = Convert.ToInt32(ddlAgeRange.SelectedValue);
            photo.WeightRangeId     = Convert.ToInt32(ddlWeightRange.SelectedValue);
            photo.ModifiedBy        = Identity.UserId;
            photo.Update();
            return(1);
        }
예제 #2
0
        protected override int SaveItem()
        {
            d.Photo   photo;
            string    photoId;
            DataTable dtPhotos = new d.PhotoData().GetNextNUncategorized(photosToDisplay);

            foreach (DataRow dr in dtPhotos.Rows)
            {
                photo               = new d.Photo(Convert.ToInt32(dr[0]));
                photoId             = photo.Id.ToString();
                photo.Gender        = Page.Request[makeHiddenId(photoId, GENDER_TYPE)].Replace("'", "");
                photo.RaceId        = Convert.ToInt32(Page.Request[makeHiddenId(photoId, RACE_TYPE)]);
                photo.HairColorId   = Convert.ToInt32(Page.Request[makeHiddenId(photoId, HAIR_TYPE)]);
                photo.AgeRangeId    = Convert.ToInt32(Page.Request[makeHiddenId(photoId, AGE_TYPE)]);
                photo.WeightRangeId = Convert.ToInt32(Page.Request[makeHiddenId(photoId, WEIGHT_TYPE)]);
                photo.IsCategorized = true;
                photo.ModifiedBy    = Identity.UserId;
                photo.Update();
            }
            return(1);
        }