コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("SheetSizeID,Name,Description,IsActive,AddedDate,UpdatedDate,AddedUserID,UpdatedUserID")] SheetSize sheetSize)
        {
            if (id != sheetSize.SheetSizeID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    sheetSize.UpdatedDate   = DateTime.Now;
                    sheetSize.UpdatedUserID = Int32.Parse(HttpContext.Session.GetString("UserID"));
                    _context.Update(sheetSize);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SheetSizeExists(sheetSize.SheetSizeID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AddedUserID"]   = new SelectList(_context.Users, "UserID", "Login", sheetSize.AddedUserID);
            ViewData["UpdatedUserID"] = new SelectList(_context.Users, "UserID", "Login", sheetSize.UpdatedUserID);
            return(View(sheetSize));
        }
コード例 #2
0
 /// <summary>
 /// Convert DrawingCategory to string
 /// </summary>
 /// <param name="value"></param>
 /// <param name="targetType"></param>
 /// <param name="parameter"></param>
 /// <param name="culture"></param>
 /// <returns></returns>
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     if (value is SheetSize && targetType == typeof(string))
     {
         SheetSize cat = (SheetSize)value;
     }
     return("Undefined");
 }
コード例 #3
0
        partial void NavigationController_TouchUpInside(UIButton sender)
        {
            var controller = UIStoryboard.FromName("Main", null).InstantiateViewController("BottomSheetNavigationController");

            SheetSize[] sheetSizes = { SheetSize.Fixed(300f) };
            var         bottomSheetViewController = new BottomSheetViewController(controller, sheetSizes);

            this.PresentModalViewController(bottomSheetViewController, false);
        }
コード例 #4
0
 public override void ViewDidAppear(bool animated)
 {
     base.ViewDidAppear(animated);
     UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseOut, () =>
     {
         this.View.BackgroundColor = OverlayColor;
         ContainerView.Transform   = CGAffineTransform.MakeIdentity();
         _actualContainerSize      = SheetSize.Fixed((float)ContainerView.Frame.Height);
     }, null);
 }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("SheetSizeID,Name,Description,IsActive,AddedDate,UpdatedDate,AddedUserID,UpdatedUserID")] SheetSize sheetSize)
        {
            if (ModelState.IsValid)
            {
                sheetSize.IsActive    = true;
                sheetSize.AddedDate   = DateTime.Now;
                sheetSize.AddedUserID = Int32.Parse(HttpContext.Session.GetString("UserID"));
                _context.Add(sheetSize);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AddedUserID"]   = new SelectList(_context.Users, "UserID", "Login", sheetSize.AddedUserID);
            ViewData["UpdatedUserID"] = new SelectList(_context.Users, "UserID", "Login", sheetSize.UpdatedUserID);
            return(View(sheetSize));
        }
コード例 #6
0
 public void Resize(SheetSize toSize, bool animated = true)
 {
     if (animated)
     {
         UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseOut, () =>
         {
             _containerHeightConstraint.Constant = GetHalfScreen();
             this.View.LayoutIfNeeded();
         }, null);
     }
     else
     {
         _containerHeightConstraint.Constant = GetHalfScreen();
     }
     _containerSize       = toSize;
     _actualContainerSize = toSize;
 }
コード例 #7
0
        public IHttpActionResult PostSize(int id, [FromBody] SheetSize data)
        {
            data.Sheet = id;

            var oldData = db.SheetSizes.Find(data.Row, data.Column, id);

            if (oldData != null)
            {
                oldData.Size = data.Size;
            }
            else
            {
                db.SheetSizes.Add(data);
            }

            db.SaveChanges();
            return(Ok("ok"));
        }