private void btnNO_Click(object sender, System.EventArgs e) { try { // check-in the current equipment into curreòå work order // next screen if(Operation == "CheckIn") { order = new clsWorkOrders(); order.iOrgId = OrgId; order.iId = OrderId; order.daCurrentDate = DateTime.Now; order.iUserId = op.Id; if(order.UpdateCheckInWorkOrder() == -1) { Session["lastpage"] = CurrentPage; Session["error"] = _functions.ErrorMessage(120); Response.Redirect("error.aspx", false); return; } else Response.Redirect("ok_viewCheckIn.aspx?orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString(), false); } else Response.Redirect(BackPage, false); } catch(Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = CurrentPage; Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if(order != null) order.Dispose(); } }
private void btnSaveNote_Click(object sender, System.EventArgs e) { DateTime daCurrentDate; try { daCurrentDate = DateTime.Now; order = new clsWorkOrders(); order.cAction = "U"; order.iOrgId = OrgId; order.iNoteId = 0; order.iNoteTypeId = (int)NoteTypes.OperatorNote; order.iItemId = OrderId; order.iUserId = op.Id; order.daCreated = daCurrentDate; order.sNote = tbNotes.Text; order.NoteDetails(); if(Operation == "CheckIn") { order.iId = OrderId; order.daCurrentDate = daCurrentDate; order.iUserId = op.Id; if(order.UpdateCheckInWorkOrder() == -1) { Session["lastpage"] = CurrentPage; Session["error"] = _functions.ErrorMessage(120); Response.Redirect("error.aspx", false); return; } else Response.Redirect("ok_viewCheckIn.aspx?orderid=" + OrderId.ToString() + "&equipid=" + EquipId.ToString(), false); } else { if(Operation == "AddCommentReOpen") Response.Redirect(BackPage + "&op=AddCommentReOpen", false); else Response.Redirect(BackPage, false); } } catch(Exception ex) { _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName); Session["lastpage"] = CurrentPage; Session["error"] = ex.Message; Session["error_report"] = ex.ToString(); Response.Redirect("error.aspx", false); } finally { if(order != null) order.Dispose(); } }