Example #1
0
		public int UpdateOutputBookingChecklist(TourBookingChecklistBDto bookingChecklist)
		{
			Database db = null;
			DbCommand dbCmd = null;
			int Result = 0;
			try
			{
				db = DatabaseFactory.CreateDatabase(DALHelper.CRM_CONNECTION_STRING);
				dbCmd = db.GetStoredProcCommand("BOOKING_TOUR_BOOKING_OUTPUT_CHECKLIST_UPDATE");

				db.AddInParameter(dbCmd, "@BOOKING_ID", DbType.Int32, bookingChecklist.BookingId);
				db.AddInParameter(dbCmd, "@CHECKLIST_ID", DbType.String, bookingChecklist.CheckListId);
				db.AddInParameter(dbCmd, "@DOC_NAME", DbType.String, bookingChecklist.documentName);
				db.AddInParameter(dbCmd, "@DOC_CONTENT", DbType.String, bookingChecklist.DocumentContent);

				Result = db.ExecuteNonQuery(dbCmd);
			}
			catch (Exception ex)
			{
				bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
				if (rethrow)
				{
					throw ex;
				}
			}
			finally
			{
				DALHelper.Destroy(ref dbCmd);
			}
			return Result;
		}
Example #2
0
		public int InsertOutputBookingChecklist(TourBookingChecklistBDto bookingChecklist)
		{
			Database db = null;
			DbCommand dbCmd = null;
			int Result = 0;
			try
			{
				db = DatabaseFactory.CreateDatabase(DALHelper.CRM_CONNECTION_STRING);
				dbCmd = db.GetStoredProcCommand("BOOKING_TOUR_BOOKING_OUTPUT_CHECKLIST_INSERT");


				db.AddInParameter(dbCmd, "@BOOKING_ID", DbType.Int32, bookingChecklist.BookingId);
				db.AddInParameter(dbCmd, "@CHECKLIST_ID", DbType.String, bookingChecklist.CheckListId);
				db.AddInParameter(dbCmd, "@DOC_NAME", DbType.String, bookingChecklist.documentName);
				db.AddInParameter(dbCmd, "@DOC_CONTENT", DbType.String, bookingChecklist.DocumentContent);
				db.AddInParameter(dbCmd, "@CHECKLIST_SRNO", DbType.Int32, bookingChecklist.SerialNo);

				if (!string.IsNullOrEmpty(bookingChecklist.Remarks))
					db.AddInParameter(dbCmd, "@REMARKS", DbType.String, bookingChecklist.Remarks);
				else
					db.AddInParameter(dbCmd, "@REMARKS", DbType.String, DBNull.Value);

				db.AddInParameter(dbCmd, "@ANSWER_YES_OR_NO", DbType.Boolean, bookingChecklist.Answer);

				Result = db.ExecuteNonQuery(dbCmd);
			}
			catch (Exception ex)
			{
				bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
				if (rethrow)
				{
					throw ex;
				}
			}
			finally
			{
				DALHelper.Destroy(ref dbCmd);
			}
			return Result;
		}