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)); }
/// <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"); }
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); }
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); }
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)); }
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; }
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")); }