Exemplo n.º 1
0
        public JsonResult UnpayedOrderList(int soSearchType, int pageIndex, int pageSize, string SearchKey)
        {
            SOPaymentStatus getSOPaymentStatus = SOPaymentStatus.All;

            switch (soSearchType)
            {
            case 13:
                getSOPaymentStatus = SOPaymentStatus.NoPay;
                break;

            case 20:
                getSOPaymentStatus = SOPaymentStatus.HasPay;
                break;

            case 21:
                getSOPaymentStatus = SOPaymentStatus.All;
                break;

            default:
                break;
            }
            return(Json(new AjaxResult()
            {
                Success = true, Data = CustomerManager.GetCustomerOrderList(getSOPaymentStatus, SOSearchType.ALL, pageIndex, pageSize, SearchKey)
            }));
        }
Exemplo n.º 2
0
		public bool UpdatePayment(long SOID, decimal PaidAmount, SOPaymentStatus paymentStatus)
		{
			try
			{
				string SQL = "UPDATE tblSO SET " +
								"PaidAmount     = PaidAmount + @PaidAmount, " +
								"UnpaidAmount   = UnpaidAmount - @PaidAmount, " +
								"PaymentStatus  = @PaymentStatus " +
							 "WHERE SOID = @SOID;";

				MySqlCommand cmd = new MySqlCommand();
				cmd.CommandType = System.Data.CommandType.Text;
				cmd.CommandText = SQL;

				MySqlParameter prmPaidAmount = new MySqlParameter("@PaidAmount",MySqlDbType.Decimal);
				prmPaidAmount.Value = PaidAmount;
				cmd.Parameters.Add(prmPaidAmount);

				MySqlParameter prmPaymentStatus = new MySqlParameter("@PaymentStatus",MySqlDbType.Int16);
				prmPaymentStatus.Value = paymentStatus.ToString("d");
				cmd.Parameters.Add(prmPaymentStatus);

				MySqlParameter prmSOID = new MySqlParameter("@SOID",MySqlDbType.Int64);
				prmSOID.Value = SOID;
				cmd.Parameters.Add(prmSOID);

				base.ExecuteNonQuery(cmd);

				return true;
			}

			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}
		}
Exemplo n.º 3
0
		/**********************************
		 * Lemuel E. Aceron
		 * July 30, 2008 17:21
		 * Added for Payment
		 **********************************/
		public bool UpdatePaymentStatus(SOPaymentStatus paymentStatus, string IDs)
		{
			try
			{
				string SQL = "UPDATE tblSO SET PaymentStatus = @PaymentStatus WHERE SOID IN (" + IDs + ");";

				MySqlCommand cmd = new MySqlCommand();
				cmd.CommandType = System.Data.CommandType.Text;
				cmd.CommandText = SQL;

				MySqlParameter prmPaymentStatus = new MySqlParameter("@PaymentStatus",MySqlDbType.Int16);
				prmPaymentStatus.Value = paymentStatus.ToString("d");
				cmd.Parameters.Add(prmPaymentStatus);

				base.ExecuteNonQuery(cmd);

				return true;
			}

			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}
		}