protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); requisition.Width = (int) primary.Width; requisition.Height = (int) primary.Height; }
protected void btnSubmit_Click(object sender, EventArgs e) { Requisition req = new Requisition(); req.Req_Form_No = empCtrl.generateID(ur.Dept_ID); req.Request_Date = DateTime.Now; req.Emp_ID = ur.Emp_ID; req.Approval_Status = 1; req.Approval_By =null; req.Approval_Date = null; req.Req_Status = null; req.Notification = false; req.Prior = false; empCtrl.submitRequisition(req); foreach (GridViewRow row in itemDetailsGrid.Rows) { Requisition_Detail rd = new Requisition_Detail(); rd.Req_Form_No = req.Req_Form_No; rd.Item_Code = row.Cells[1].Text; rd.Description = row.Cells[2].Text; rd.Qty = Convert.ToInt32((row.Cells[3]).Text); empCtrl.submitRequisitionDetails(rd); } this.itemDetailsGrid.DataSource = null; User u = new User(); u.Emp_ID = ur.Emp_ID; empCtrl.sendEmailToDeptHead(u); data = new List<fields>(); lblStatus.Text = "The Requisition was submitted successfully"; ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Record saved successfully.');window.location='Emp-Welcom.aspx';", true); }
public Message actionCreateRequisition(Requisition objIn) { objIn.datetime_requested = DateTime.Now; objIn.status = 0; try { data.Requisitions.AddObject(objIn); Stationery stationery = data.Stationeries.Where(o => o.id == objIn.stationery).SingleOrDefault(); User employee = data.Users.Where(o=> o.id == objIn.user_obj).SingleOrDefault(); Department dept = data.Departments.Where(o=> o.id == objIn.department).SingleOrDefault(); User head = data.Users.Where(o=> o.id == dept.department_head).SingleOrDefault(); String email_title = "Stationery Requesting from " + employee.firstname + " " + employee.lastname; String email_body = "<p>Hello " + head.firstname + " " + head.lastname + ",</p>" + "<p>The following item is requested from " + employee.firstname + " " + employee.lastname + ".</p>" + "<p><b>Stationery Name : " + stationery.stationery_name + "<br />" + "Quantity : " + objIn.quantity + " " + stationery.unit_of_measure+ "</b></p>" + "<p>Please click the following link to login to your account and approve.<br /> " + Configs.APP_URL_ROOT+ "<br />Thank you,<br/> Logic University.<p>This is system generated mail. Please do not reply.</p>"; Helper.sendMail(head.email, "*****@*****.**", email_title, email_body); return this.getNewDefaultMessageForDBOperations(data.SaveChanges() == 1); } catch (Exception e) { return this.getNewDefaultMessageForException(e); } }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); const int upperBound = 20; if (Allocation.Width > 0 && Math.Abs (Allocation.Width - requisition.Width) < upperBound) requisition.Width = Math.Max (Allocation.Width, requisition.Width); }
protected override void OnSizeRequested (ref Requisition requisition) { if (child != null) requisition = child.SizeRequest (); else base.OnSizeRequested (ref requisition); }
protected override void OnSizeRequested(ref Requisition requisition) { if (this.Child != null) { requisition = this.Child.SizeRequest(); } }
protected void btnApprove_Click(object sender, EventArgs e) { List<Requisition> RqList = new List<Requisition>(); List<Requisition> RqrejList = new List<Requisition>(); string EmpID = ur.Emp_ID; string DeptID = ur.Dept_ID; foreach (GridViewRow row in gvReqList.Rows) { CheckBox chk = (CheckBox)row.FindControl("chkSelect"); if (chk.Checked) { Requisition req = new Requisition(); req.Req_Form_No = row.Cells[2].Text; req.Approval_Status = 2; RqList.Add(req); } else { Requisition req = new Requisition(); req.Req_Form_No = row.Cells[2].Text; RqrejList.Add(req); } } string Req_No = approve.generateID(DeptID); arControl.approveSelectedRequisitions(RqList, Req_No, EmpID, DeptID, RqrejList); if (RqrejList.Count() > 0) { Session["DepId"] = DeptID; Response.Redirect("rejectReq.aspx"); } }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); if (wRequest > 0) { requisition.Width = wRequest; } }
protected override void OnSizeRequested (ref Requisition req) { base.OnSizeRequested (ref req); if (req.Width <= 0) req.Width = minSize; if (req.Height <= 0) req.Height = minSize; }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); if (SizeFunc != null) { requisition.Width = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2); } }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); if (box.Child != null) { requisition = box.Child.SizeRequest (); requisition.Height += 2 * box.Child.Style?.YThickness ?? 0; } else requisition = box.SizeRequest (); }
protected override void OnSizeRequested (ref Requisition req) { if (Orientation == Orientation.Horizontal) { req.Width = GripSize + MarginLeft + MarginRight; req.Height = 0; } else { req.Width = 0; req.Height = GripSize + MarginLeft + MarginRight; } }
protected override void OnSizeRequested (ref Requisition requisition) { if (child != null) { requisition = child.SizeRequest (); requisition.Width += leftMargin + rightMargin + leftPadding + rightPadding; requisition.Height += topMargin + bottomMargin + topPadding + bottomPadding; } else { requisition.Width = 0; requisition.Height = 0; } }
protected void btnOk_Click(object sender, EventArgs e) { reasone = txtReasone.Text; foreach (GridViewRow row in gvRejectedRequest.Rows) { Requisition req = new Requisition(); req.Req_Form_No = row.Cells[0].Text; req.Approval_Status = 0; req.Rej_Comment = reasone; erControl.updateRejectedRequisition(req); } Response.Redirect("Head-welcome.aspx"); }
public string makeRequisition(string jsonStr) { JObject portlet = JObject.Parse(jsonStr); string userName = portlet["user"].ToString(); User user = userDAO.findUserByName(userName); Requisition req = new Requisition(); req.userID = user.userID; req.date = System.DateTime.Now; req.departmentCode = user.departmentCode; req.status = "Processing"; req.type = "Normal"; int rId = requisitionDAO.makeRequisition(req); JToken list = portlet["requisitionList"]; string result = requisitionDetailDAO.makeRequisitionDetail(list, rId); return(result); }
protected override void OnSizeRequested(ref Requisition requisition) { base.OnSizeRequested(ref requisition); requisition.Width = (Orientation == Orientation.Horizontal ? min_length : BackgroundTile.Width) + 2 * x_offset; requisition.Height = (Orientation == Orientation.Vertical ? min_height : BackgroundTile.Height) + 2 * y_offset; switch (Orientation) { case Orientation.Horizontal: if (min_length % BackgroundTile.Width != 0) { requisition.Width += BackgroundTile.Width - min_length % BackgroundTile.Width; } break; case Orientation.Vertical: if (min_height % BackgroundTile.Height != 0) { requisition.Height += BackgroundTile.Height - min_height % BackgroundTile.Height; } break; } }
protected override void OnSizeRequested(ref Requisition req) { maxLength = 15; foreach (var cat in categories) { foreach (var item in cat.Items) { maxLength = Math.Min(30, Math.Max(maxLength, (item.ListTitle ?? item.Title).Length)); } } var layout = PangoUtil.CreateLayout(this); int w, h; layout.SetText(new string ('X', maxLength)); layout.GetPixelSize(out w, out h); layout.Dispose(); int totalWidth = 0; int totalHeight = 0; var firstNonEmptyCat = categories.FirstOrDefault(c => c.Items.Count > 0); if (firstNonEmptyCat == null) { return; } var icon = firstNonEmptyCat.Items[0].Icon; var iconHeight = Math.Max(h, (int)icon.Height + 2) + itemPadding * 2; var iconWidth = (int)icon.Width + 2 + w + itemPadding * 2; foreach (var cat in categories) { var headerHeight = h + headerDistance; totalHeight = Math.Max(totalHeight, headerHeight + (Math.Min(cat.Items.Count, maxItems)) * iconHeight); totalWidth += (1 + Math.Min(maxRows - 1, cat.Items.Count / maxItems)) * iconWidth; } req.Width = totalWidth + padding * 2 + (categories.Count - 1) * padding; req.Height = totalHeight + padding * 2; }
void SetChildrenPositions(Rectangle allocation) { foreach (EditorContainerChild child in containerChildren.ToArray()) { if (child.Child == textEditorWidget) { continue; } Requisition req = child.Child.SizeRequest(); var childRectangle = new Gdk.Rectangle(child.X, child.Y, req.Width, req.Height); if (!child.FixedPosition) { double zoom = textEditorWidget.Options.Zoom; childRectangle.X = (int)(child.X * zoom - textEditorWidget.HAdjustment.Value); childRectangle.Y = (int)(child.Y * zoom - textEditorWidget.VAdjustment.Value); } childRectangle.X += allocation.X; childRectangle.Y += allocation.Y; child.Child.SizeAllocate(childRectangle); } }
protected override void OnSizeAllocated(Gdk.Rectangle rect) { base.OnSizeAllocated(rect); foreach (WidgetPosition pos in widgets) { Requisition req = GetChildRequisition(pos.Widget); Rectangle crect = new Rectangle(pos.X, pos.Y, req.Width, req.Height); switch (placement) { case Placement.Top: break; case Placement.Bottom: crect.Y = Allocation.Height - crect.Y - crect.Height; break; case Placement.Left: { int t = crect.X; crect.X = crect.Y; crect.Y = t; break; } case Placement.Right: { int t = crect.X; crect.X = crect.Y; crect.Y = t; crect.X = Allocation.Width - crect.X - crect.Width; break; } } crect.X += Allocation.X; crect.Y += Allocation.Y; pos.Widget.SizeAllocate(crect); } }
public ActionResult Edit([Bind(Include = "Id,FromPlace,DestinationPlace,StartDateTime,StartTime,EndDateTime,EndTime,PassengerQty,Description,RequestFor,EmployeeId,RequisitionNumber,SubmitDateTime")] RequisitionViewModel requisitionViewModel) { try { if (ModelState.IsValid) { var startDate = requisitionViewModel.StartDateTime.ToString("MM/dd/yyyy"); var startTime = requisitionViewModel.StartTime; DateTime startDateTime = Convert.ToDateTime(startDate + " " + startTime); requisitionViewModel.StartDateTime = startDateTime; var endDate = requisitionViewModel.EndDateTime.ToString("MM/dd/yyyy"); var endTime = requisitionViewModel.EndTime; DateTime endDateTime = Convert.ToDateTime(endDate + " " + endTime); requisitionViewModel.EndDateTime = endDateTime; DateTime submitedDateTime = requisitionViewModel.SubmitDateTime; //Get employee Id by user login id var loginUserId = Convert.ToInt32(User.Identity.GetUserId()); var empId = _employeeManager.FindByLoginId(loginUserId); requisitionViewModel.EmployeeId = empId.Id; Requisition requisition = Mapper.Map <Requisition>(requisitionViewModel); requisition.SubmitDateTime = submitedDateTime; _requisitionManager.Update(requisition); TempData["msg"] = "Information has been updated successfully"; return(RedirectToAction("Create")); } ViewBag.EmployeeId = new SelectList(_employeeManager.GetAll(), "Id", "FullName", requisitionViewModel.EmployeeId); return(View(requisitionViewModel)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Edit"))); } }
protected override void OnSizeRequested(ref Requisition req) { req.Width = req.Height = 0; foreach (WidgetPosition pos in widgets) { Requisition wreq = pos.Widget.SizeRequest(); if (placement == Placement.Top || placement == Placement.Bottom) { if (pos.X + wreq.Width > req.Width) { req.Width = pos.X + wreq.Width; } if (pos.Y + wreq.Height > req.Height) { req.Height = pos.Y + wreq.Height; } } else { if (pos.Y + wreq.Width > req.Width) { req.Width = pos.Y + wreq.Width; } if (pos.X + wreq.Height > req.Height) { req.Height = pos.X + wreq.Height; } } } if (placement == Placement.Top || placement == Placement.Bottom) { req.Width = 0; } else { req.Height = 0; } }
public void SaveAndDeleteTestNew() { // Save new object into DB // Arrange var requisition = new Requisition { RequisitionId = "RQREPOTEST", CreatedDateTime = DateTime.Now }; // Act var saveResult = requisitionRepository.Save(requisition); // Assert Assert.IsInstanceOfType(saveResult, typeof(Requisition)); // Delete saved object from DB // Act requisitionRepository.Delete(saveResult); // Assert Assert.IsNull(requisitionRepository.FindById("RQREPOTEST")); }
public ActionResult Feedback([Bind(Include = "Id,RequisitionId,CommentText")] FeedbackViewModel feedbackViewModel) { try { if (ModelState.IsValid) { Feedback feedback = Mapper.Map <Feedback>(feedbackViewModel); _feedbackManager.Add(feedback); ViewBag.Msg = "Comment Save successfully"; Requisition requisition = _requisitionManager.FindById(feedbackViewModel.RequisitionId); RequisitionViewModel requisitionViewModel = Mapper.Map <RequisitionViewModel>(requisition); feedbackViewModel.Requisition = requisition; ViewBag.Feedback = _feedbackManager.GetAll().Where(c => c.RequisitionId == feedbackViewModel.RequisitionId); } return(View(feedbackViewModel)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Feedback"))); } }
// GET: Requisitions/Edit/5 public ActionResult Edit(int?id) { try { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Requisition requisition = _requisitionManager.FindById((int)id); if (requisition == null) { return(HttpNotFound()); } ViewBag.EmployeeId = new SelectList(_employeeManager.GetAll(), "Id", "FullName", requisition.EmployeeId); RequisitionViewModel requisitionViewModel = Mapper.Map <RequisitionViewModel>(requisition); return(View(requisitionViewModel)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Edit"))); } }
// To check if the requistion is fulfilled with iterating through each items. public bool isPartialFufiled(Requisition req) { List <RequisitionDetail> details = req.RequisitionDetails.ToList(); bool verdict = false; List <bool> result = new List <bool>(); foreach (var d in details) { if (d.RequestedQty - d.DistributedQty == 0) { result.Add(false); } else { result.Add(true); } } if (result.Contains(true)) { return(verdict = true); } return(verdict); }
public async Task <Requisition> RejectRequisitionForm(Requisition req, HttpSessionStateBase session) { Requisition requisition = db.Requisitions.Where(x => x.requisitionId == req.requisitionId).First(); if (session["Role"].ToString() == "clerk") { requisition.status = "Rejected by store clerk"; } else { requisition.status = "Rejected by head"; } requisition.remark = req.remark; await db.SaveChangesAsync(); EmailBusinessLogic emailBizLogic = new EmailBusinessLogic(); string sender = session["EmployeeID"].ToString(); string receipient = req.employee; string linkref = "http://" + ConstantsConfig.ipaddress + "/Requisition/ReqFormDetail?id=" + req.requisitionId; emailBizLogic.SendEmail("updateReqStatus", receipient, sender, null, "Rejected", linkref); return(requisition); }
public void ApproveRejectPendingRequisition(int requisitionId, string action, string remarks) { Requisition r = requisitionRepo.FindById(requisitionId); if (remarks != null) { r.Remarks = remarks; } if (action.Equals("approve")) { r.Status = RequisitionStatusEnum.APPROVED.ToString(); requisitionRepo.Update(r); CascadeToRequisitionDetails(action, requisitionId); } else { r.Status = RequisitionStatusEnum.REJECTED.ToString(); requisitionRepo.Update(r); CascadeToRequisitionDetails(action, requisitionId); } emailNotificationService.NotifyEmployeeApprovedOrRejectedRequisition(r, r.Employee); }
public IActionResult DisbursementDetail(long date, string deptid) { ViewData["Role"] = CommonConstant.ROLE_NAME[(string)HttpContext.Session.GetString("Role")]; ViewData["Name"] = (string)HttpContext.Session.GetString("Name"); Requisition requisition = new Requisition(); requisition.CollectionDate = date; requisition.DepartmentId = deptid; string url = cfg.GetValue <string>("Hosts:Boot") + "/storeclerk/disbursement"; Result <List <RequisitionDetail> > result = HttpUtils.Post(url, requisition, new List <RequisitionDetail>(), Request, Response); if (result.code == 200) { ViewData["disbursementList"] = result.data; return(View()); } else { return(RedirectToAction("Disbursement", "StoreClerk", new { errMsg = result.msg })); } }
public static Requisition MapToClientWithoutItemRequisition(Requisition req) { Requisition requisition = new Requisition() { Id = req.Id, RequisitionDate = req.RequisitionDate, RequisitionBy = req.RequisitionBy, Purpose = req.Purpose, ToStoreId = req.ToStoreId, ToStore = req.ToStore != null?MapToClient(req.ToStore) : null, FromStoreId = req.FromStoreId, FromStore = req.FromStore != null?MapToClient(req.FromStore) : null, IsSubStoreRequisition = req.IsSubStoreRequisition, Note = req.Note, IsOpen = req.IsOpen, UserId = req.UserId, Active = req.Active, //ItemRequisitions = req.ItemRequisitions != null ? MapToClient(req.ItemRequisitions) : null, //ItemRequisitions = req.ItemRequisitions != null ? MapToClient(req.ItemRequisitions) : null, }; return(requisition); }
public ActionResult SubmitRequisitionForm() { if (Session["existinguser"] != null) { LoginDTO currentUser = (LoginDTO)Session["existinguser"]; if (currentUser.RoleId == (int)Enums.Roles.StoreClerk && currentUser.RoleId == (int)Enums.Roles.StoreSupervisor && currentUser.RoleId == (int)Enums.Roles.StoreManager) { return(RedirectToAction("RedirectToClerkOrDepartmentView", "Login")); } //check if cart is NOT empty if (CartNotEmpty(currentUser.EmployeeId)) { //convert all cart items into requsitiondetails for this requisition Requisition newRequisition = requisitionCatalogueService.ConvertCartDetailsToRequisitionDetails(currentUser.EmployeeId); //notify dept head for approval emailNotificationService.NotifyDeptHeadToApprovePendingRequisition(newRequisition); } return(RedirectToAction("ViewCatalogue")); } return(RedirectToAction("Index", "Login")); }
//methods for departmentwise consolidation //moblie public void saveDisburseList(List <string> reqIdByDeptList, Dictionary <string, int> itemDic, Disbursement NewDisbursement) { using (InventorySysDBEntities context = new InventorySysDBEntities()) { context.Disbursements.Add(NewDisbursement); foreach (string reqId in reqIdByDeptList) { var q = from x in context.Requisitions where x.Requisition_ID == reqId select x; Requisition r = q.First(); r.Disbursement_ID = NewDisbursement.Disbursement_ID; } foreach (string itemID in itemDic.Keys) { DisbursementDetail disburementDetail = new DisbursementDetail(); disburementDetail.Disbursement_ID = NewDisbursement.Disbursement_ID; disburementDetail.Item_ID = itemID; disburementDetail.Quantity = itemDic[itemID]; context.DisbursementDetails.Add(disburementDetail); } context.SaveChanges(); } }
private void Init() { ChargeID = 0; PaymentID = 0; RequisitionID = 0; CompanyID = 1; FundID = 0; DepartmentID = 0; AccountID = 0; ProjectID = null; FYStartDate = new DateTime(DateTime.Now.Year, 1, 1); Amount = 0; CreatedByUserID = String.Empty; ModifiedByUserID = String.Empty; DateCreated = DateTime.MinValue; DateModified = DateTime.MinValue; Active = true; mCreatedBy = null; mModifiedBy = null; mPayment = null; mRequisition = null; }
public ActionResult DeleteConfirmed(int id) { try { Requisition requisition = _requisitionManager.FindById(id); bool IsDeleted = _requisitionManager.Remove(requisition); if (IsDeleted) { RequisitionHistory history = new RequisitionHistory(); history.Status = "New"; history.RequisitionId = requisition.Id; history.DeletedDateTime = DateTime.Now; _requisitionHistoryManager.Update(history); } TempData["msg"] = "Information has been deleted successfully"; return(RedirectToAction("Index")); } catch (Exception ex) { ExceptionMessage(ex); return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Delete"))); } }
// See Requisition Details public ActionResult ReqFormDetail(string id) { Requisition requisition = new Requisition(); if (id == "" || id is null) { requisition = (Requisition)TempData["RequisitionFormGeneration"]; } try { SSISEntities db = new SSISEntities(); requisition = db.Requisitions.Where(x => x.requisitionId == id).First(); if (requisition.RequisitionDetails == null) { requisition = reqBizLogic.GetRequisitionDetails(requisition); } } catch (Exception e) { //log } return(View(requisition)); }
public void UpdateApproveStatus(Requisition requisition, string comments, int?approvedbyId) { requisition.RequisitionStatus = "Approved"; requisition.Comment = comments; requisition.ApprovedDate = DateTime.Today.Date; requisition.ApprovedBy = approvedbyId; db.Entry(requisition).State = EntityState.Modified; db.SaveChanges(); string reqListId = requisition.RequisitionId.ToString(); notify.NewRequisitonMade(reqListId); try { string emailBody = requisition.Employee.EmployeeName + ", your requisition dated " + requisition.OrderedDate.Value.Date.ToString("dd/MM/yyyy") + " has been approved. Please go to http://" + uSvc.GetBaseUrl() + "/Stationery/Requisition/" + requisition.RequisitionId + " for more information."; uSvc.SendEmail(new List <string>(new string[] { requisition.Employee.Email }), "Approved Requisition", emailBody); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.ToString()); } }
protected Requisition SizeRequested() { var requisition = new Requisition(); if (child != null && child.Visible) { // Add the child's width/height Requisition child_requisition, nat_requisition; child.GetPreferredSize(out child_requisition, out nat_requisition); requisition.Width = Math.Max(0, child_requisition.Width); requisition.Height = child_requisition.Height; } else { requisition.Width = 0; requisition.Height = 0; } // Add the frame border requisition.Width += ((int)BorderWidth + frame_width) * 2; requisition.Height += ((int)BorderWidth + frame_width) * 2; return(requisition); }
public static string ApproveRequisition(string comment, string reqId) { string update = "false"; Requisition r = (from x in m.Requisitions where x.RequisitionID.Equals(reqId) select x).First(); r.Status = "Approved"; r.CommentsByHead = comment; r.ApprovalDate = DateTime.Now; if (m.SaveChanges() > 0) { update = "true"; } else { update = "false"; } return(update); }
protected override void OnSizeRequested (ref Requisition req) { Requisition headerReq, tileReq; headerReq = header.SizeRequest (); tileReq.Width = tileReq.Height = 0; foreach (Widget w in AllTiles) { tileReq = w.SizeRequest (); req.Width = Math.Max (req.Width, tileReq.Width); req.Height = Math.Max (req.Height, tileReq.Height); } req.Height = (Expanded) ? headerReq.Height + PageSize * tileReq.Height : headerReq.Height + 2; req.Width = Math.Max (headerReq.Width + headerReq.Height, tileReq.Width + 2 * headerReq.Height); req.Width += (int)(2 * BorderWidth); req.Height += (int)(2 * BorderWidth); }
protected Requisition SizeRequested() { var requisition = new Requisition(); Pango.FontMetrics metrics = PangoContext.GetMetrics(StyleContext.GetFont(StateFlags), PangoContext.Language); renderer.Size = ((int)(metrics.Ascent + metrics.Descent) + 512) >> 10; // PANGO_PIXELS(d) metrics.Dispose(); if (HasFrame) { renderer.Xpad = MarginLeft + (interior_focus ? focus_width : 0) + 2; renderer.Ypad = MarginTop + (interior_focus ? focus_width : 0) + 2; } else { renderer.Xpad = 0; renderer.Ypad = 0; } requisition.Width = renderer.Width; requisition.Height = renderer.Height; return(requisition); }
protected override void OnSizeRequested(ref Requisition requisition) { if (Widget != null) { Requisition req = Widget.SizeRequest(); widget_alloc.Width = req.Width; widget_alloc.Height = req.Height; } if (horizontal) { Width = Choreographer.PixelCompose(percent, widget_alloc.Width + StartPadding + EndPadding, Easing); Height = widget_alloc.Height; } else { Width = widget_alloc.Width; Height = Choreographer.PixelCompose(percent, widget_alloc.Height + StartPadding + EndPadding, Easing); } requisition.Width = Width; requisition.Height = Height; }
void HideReplaceUI() { if (!replaceMode) { return; } buttonReplace.Destroy(); buttonReplace = null; buttonSearch.GrabDefault(); StoreHistory("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); TableRemoveRow(tableFindAndReplace, 1, labelReplace, comboboxentryReplace, true); comboboxentryReplace = null; labelReplace = null; replaceMode = false; Requisition req = SizeRequest(); Resize(req.Width, req.Height); }
public IHttpActionResult ProcessRequisitions(List <string> reqIdList) { List <Requisition> reqList = new List <Requisition>(); string rid; List <string> errorList = new List <string>(); try { foreach (string s in reqIdList) { Requisition req = requisitionRepository.FindById(s); if (req.Status.StatusId == 6) { reqList.Add(req); } else { errorList.Add(req.RequisitionId); } } // create retrieval only if there are Requisitions to be processed if (reqList.Count > 0) { rid = requisitionService.ProcessRequisitions(reqList); } else { throw new Exception("No Requisitions could be processed."); } } catch (Exception e) { return(BadRequest(e.Message)); } return(Ok(new { rid, count = reqList.Count })); }
protected override void OnSizeRequested(ref Requisition requisition) { if (!realSizeRequest) { // Request a minimal width, to size recalculation infinite loops with // small widths, due to the vscrollbar being shown and hidden. requisition.Width = 50; requisition.Height = 0; return; } int xpos = 0; int ypos = 0; Iterate(ref xpos, ref ypos, null, null); requisition.Width = 50; requisition.Height = ypos; if (this.vAdjustement != null) { this.vAdjustement.SetBounds(0, ypos, 20, Allocation.Height, Allocation.Height); if (ypos < Allocation.Height) { this.vAdjustement.Value = 0; } if (vAdjustement.Value + vAdjustement.PageSize > vAdjustement.Upper) { vAdjustement.Value = vAdjustement.Upper - vAdjustement.PageSize; } if (vAdjustement.Value < 0) { vAdjustement.Value = 0; } } }
protected override void OnSizeRequested (ref Requisition req) { Requisition headerReq, tileReq; req.Height = req.Width = 0; headerReq = header.SizeRequest (); tileReq.Width = tileReq.Height = 0; foreach (Widget w in AllTiles) { tileReq = w.SizeRequest (); req.Width = Math.Max (req.Width, tileReq.Width); req.Height = Math.Max (req.Height, tileReq.Height); } // req is now the max width/height of a single tile. Indent // req.Width, and use that as our width request, so that the // minimum width you can resize the category to is wide enough to // fit a whole column. But request a req.Height that is only tall // enough to fit PageSize tiles if we get the number of columns // we'd wanted. (OnSizeAllocated will force a recalculation with // fewer columns if we don't get enough width.) req.Width += 2 * headerReq.Height; req.Height *= (PageSize + Columns - 1) / Columns; if (!Expanded) req.Height = 2; // keep a thin line of background. // Add height for the header, and update the width if the header // is wider than the tile area req.Height += headerReq.Height; req.Width = Math.Max (req.Width, headerReq.Width); // Handle BorderWidth req.Width += (int)(2 * BorderWidth); req.Height += (int)(2 * BorderWidth); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Team10ADModel context = new Team10ADModel(); string requisitionid = (string)Session["requisitiondetail"]; reqid = Convert.ToInt32(requisitionid); Requisition req = RayBizLogic.GetRequisitionById(requisitionid); int currentEmpId = (int)Session["employeeid"]; //int currentEmpId = 104; int approverID = (int)Session["ApproverID"]; if (currentEmpId == req.RequestorID && req.Status == "Pending") { CancelButton.Visible = true; } else if (currentEmpId == approverID && req.Status == "Pending") { btnApprove.Visible = true; btnReject.Visible = true; lblRemarks.Visible = true; txtBoxRemarks.Visible = true; txtBoxRemarks.ReadOnly = false; } //if currentEmId = approverId, approve and reject buttons will show var qry = from r in context.RequisitionDetails where r.RequisitionID == reqid select new { r.Catalogue.ItemCode, r.Catalogue.Description, r.QuantityRequested, r.Catalogue.UnitOfMeasure }; dgvRequisitionDetail.DataSource = qry.ToList(); dgvRequisitionDetail.DataBind(); dgvRequisitionDetail.AllowPaging = true; Model.Employee emp = context.Employees.Where(x => x.EmployeeID == req.RequestorID).First(); NameTextBox.Text = emp.Name; StatusTextBox.Text = req.Status; txtBoxRemarks.Text = req.Remarks; } }
protected override void OnSizeRequested(ref Requisition req) { // The Toplevel check is done to ensure that this widget is anchored, // otherwise the Realize call will fail. if (!child.IsRealized && Toplevel is Gtk.Window) { child.Realize(); } req = child.SizeRequest(); // Make some room for the border req.Width += padding * 2 + selectionBorder * 2; req.Height += padding * 2 + selectionBorder * 2; selectionBox.SizeRequest(); if (selectionBox.Allocation.Width > req.Width) { req.Width = selectionBox.Allocation.Width; } if (selectionBox.Allocation.Height > req.Height) { req.Height = selectionBox.Allocation.Height; } foreach (TopLevelChild tchild in topLevels) { Gtk.Requisition treq = tchild.Child.SizeRequest(); if (tchild.X + treq.Width > req.Width) { req.Width = tchild.X + treq.Width; } if (tchild.Y + treq.Height > req.Height) { req.Height = tchild.Y + treq.Height; } } }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); if (widget.treeStore.IterNChildren () == 0) { //Pad the bottom with empty space. This prevents empty plists from having nowhere to click to adds rows requisition.Height += 20; } }
protected override void OnSizeRequested(ref Requisition requisition) { requisition.Width = (int) btnNormal.Size.Width; requisition.Height = (int) btnNormal.Size.Height + 2; base.OnSizeRequested (ref requisition); }
protected override void OnSizeRequested(ref Requisition req) { req.Width = req.Height = 0; foreach (WidgetPosition pos in widgets) { Requisition wreq = pos.Widget.SizeRequest (); if (placement == Placement.Top || placement == Placement.Bottom) { if (pos.X + wreq.Width > req.Width) req.Width = pos.X + wreq.Width; if (pos.Y + wreq.Height > req.Height) req.Height = pos.Y + wreq.Height; } else { if (pos.Y + wreq.Width > req.Width) req.Width = pos.Y + wreq.Width; if (pos.X + wreq.Height > req.Height) req.Height = pos.X + wreq.Height; } } if (placement == Placement.Top || placement == Placement.Bottom) req.Width = 0; else req.Height = 0; }
protected override void OnSizeRequested (ref Requisition req) { // The Toplevel check is done to ensure that this widget is anchored, // otherwise the Realize call will fail. if (!child.IsRealized && Toplevel is Gtk.Window) child.Realize (); req = child.SizeRequest (); // Make some room for the border req.Width += padding * 2 + selectionBorder * 2; req.Height += padding * 2 + selectionBorder * 2; selectionBox.SizeRequest (); if (selectionBox.Allocation.Width > req.Width) req.Width = selectionBox.Allocation.Width; if (selectionBox.Allocation.Height > req.Height) req.Height = selectionBox.Allocation.Height; foreach (TopLevelChild tchild in topLevels) { Gtk.Requisition treq = tchild.Child.SizeRequest (); if (tchild.X + treq.Width > req.Width) req.Width = tchild.X + treq.Width; if (tchild.Y + treq.Height > req.Height) req.Height = tchild.Y + treq.Height; } }
protected override void OnSizeRequested (ref Requisition req) { base.OnSizeRequested (ref req); if (scrollMode || Child == null) { req.Width = 0; req.Height = 0; } else req = Child.SizeRequest (); }
protected override void OnSizeRequested (ref Requisition requisition) { if (HeightRequest != -1 && box.HeightRequest != HeightRequest) box.HeightRequest = HeightRequest; if (box.HeightRequest != -1 && HeightRequest == -1) box.HeightRequest = -1; base.OnSizeRequested (ref requisition); }
void OnSizeReq (object o, SizeRequestedArgs a) { if (!AllowResize) { a.RetVal = false; QueueDraw (); return; } currentSizeRequest = a.Requisition; Rectangle alloc = child.Allocation; int nw = alloc.Width; int nh = alloc.Height; if (a.Requisition.Width > nw) nw = a.Requisition.Width; if (a.Requisition.Height > nh) nh = a.Requisition.Height; if (nw != alloc.Width || nh != alloc.Height) { int ow = child.WidthRequest; int oh = child.HeightRequest; child.SetSizeRequest (nw, nh); if (ow > nw) child.WidthRequest = ow; if (oh > nh) child.HeightRequest = oh; QueueDraw (); } }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); requisition.Width = requisition.Height = 16; }
protected override void OnSizeRequested(ref Requisition requisition) { // Calculate desired size here. requisition.Height = 150; requisition.Width = 150; }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); requisition.Width = Platform.IsWindows? 17 : 14; }
protected override void OnSizeRequested (ref Requisition requisition) { int width, height; layout.GetPixelSize (out width, out height); if (Pixbuf != null) { width += Pixbuf.Width + pixbufSpacing * 2; height = System.Math.Max (height, Pixbuf.Height); } else { height = System.Math.Max (height, defaultIconHeight); } // if (DrawRightBorder) // width += 2; int arrowHeight = height / 2; int arrowWidth = arrowHeight + 1; requisition.Height = height + ySpacing * 2; requisition.Width = width + arrowWidth + leftSpacing; }
protected Requisition SizeRequested() { var requisition = new Requisition (); Pango.FontMetrics metrics = PangoContext.GetMetrics (StyleContext.GetFont (StateFlags), PangoContext.Language); renderer.Size = ((int)(metrics.Ascent + metrics.Descent) + 512) >> 10; // PANGO_PIXELS(d) metrics.Dispose (); if (HasFrame) { renderer.Xpad = MarginLeft + (interior_focus ? focus_width : 0) + 2; renderer.Ypad = MarginTop + (interior_focus ? focus_width : 0) + 2; } else { renderer.Xpad = 0; renderer.Ypad = 0; } requisition.Width = renderer.Width; requisition.Height = renderer.Height; return requisition; }
protected override void OnSizeRequested (ref Requisition requisition) { if (overlayWidget != null) overlayWidget.SizeRequest (); base.OnSizeRequested (ref requisition); }
protected override void OnSizeRequested (ref Requisition requisition) { base.OnSizeRequested (ref requisition); requisition.Width = Math.Max (480, requisition.Width); }