public override string ToString() { return("ID #" + RequisitionID.ToString() + " at " + ReqDate.ToShortDateString() + " by " + User.FullName); }
protected void lvREQRequisition_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 RequisitionID; Int64.TryParse(e.CommandArgument.ToString(), out RequisitionID); if (RequisitionID > 0) { if (string.Equals(e.CommandName, "CancelItem")) { try { _RequisitionID = RequisitionID; Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(REQRequisitionEntity.FLD_NAME_RequisitionID, RequisitionID.ToString(), SQLMatchType.Equal); REQRequisitionEntity rEQRequisitionEntity = CurrentREQRequisitionEntity;//FCCREQRequisition.GetFacadeCreate().GetByID(_RequisitionID); rEQRequisitionEntity.RequisitionStatusID = MasterDataConstants.RequisitionStatus.CANCELED; result = FCCREQRequisition.GetFacadeCreate().Update(rEQRequisitionEntity, fe, DatabaseOperationType.Update, TransactionRequired.No); if (result > 0) { _RequisitionID = 0; _REQRequisitionEntity = new REQRequisitionEntity(); PrepareInitialView(); BindREQRequisitionList(); MiscUtil.ShowMessage(lblMessage, "Requisition has been successfully Rejected.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to Requisition Rejected", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
protected void lvREQRequisition_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 RequisitionID; Int64.TryParse(e.CommandArgument.ToString(), out RequisitionID); if (RequisitionID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _RequisitionID = RequisitionID; PrepareEditView(); } else if (string.Equals(e.CommandName, "ReportRequisition")) { } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(REQRequisitionEntity.FLD_NAME_RequisitionID, RequisitionID.ToString(), SQLMatchType.Equal); REQRequisitionEntity rEQRequisitionEntity = new REQRequisitionEntity(); result = FCCREQRequisition.GetFacadeCreate().Delete(rEQRequisitionEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _RequisitionID = 0; _REQRequisitionEntity = new REQRequisitionEntity(); PrepareInitialView(); BindREQRequisitionList(); MiscUtil.ShowMessage(lblMessage, "Requisition has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Requisition.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
protected void lvREQRequisition_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 RequisitionID; Int64.TryParse(e.CommandArgument.ToString(), out RequisitionID); if (string.Equals(e.CommandName, "UpdateItem")) { try { _RequisitionID = RequisitionID; REQRequisitionEntity rEQRequisitionEntity = CurrentREQRequisitionEntity; rEQRequisitionEntity.IsAccountsMadePayment = true; Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(REQRequisitionEntity.FLD_NAME_RequisitionID, RequisitionID.ToString(), SQLMatchType.Equal); result = FCCREQRequisition.GetFacadeCreate().Update(rEQRequisitionEntity, fe, DatabaseOperationType.Update, TransactionRequired.No); if (result > 0) { _RequisitionID = 0; _REQRequisitionEntity = new REQRequisitionEntity(); BindREQRequisitionList(); //MiscUtil.ShowMessage(lblMessage, "Requisition has been successfully Updated.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to Update Requisition.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }