using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
using SyntacticSugar.constant;
namespace WebAPI.Controllers
{
//收款单Controller
public class Xs_ReceivableBillController : ApiController
{
//获取系统参数
Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
public DBUtility.ClsPub.Enum_BillStatus BillStatus;
public DAL.ClsXs_ReceivableBill BillOld = new DAL.ClsXs_ReceivableBill();
public DAL.ClsXs_ReceivableBill BillNew0 = new DAL.ClsXs_ReceivableBill();
private json objJsonResult = new json();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
#region 应收单列表 根据单价类型获取物料单击
///
/// 返回应收单列表
///参数:string sql。
///返回值:object。
///
[Route("Xs_ReceivableBill/getPriceByType")]
[HttpGet]
public object getPriceByType(string HMaterID, string HType)
{
try
{
string sql1 = "exec h_p_Xs_ReceivableBill_getPriceByType " + HMaterID + ",'" + HType + "'";
ds = oCN.RunProcReturn(sql1, "h_p_Xs_ReceivableBill_getPriceByType");
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess!";
objJsonResult.data = ds.Tables[0].Rows[0]["HPrice"].ToString();
return objJsonResult;
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#region 应收单列表 查询
///
/// 返回应收单列表
///参数:string sql。
///返回值:object。
///
[Route("Xs_ReceivableBill/list")]
[HttpGet]
public object getXs_ReceivableBill(string sWhere, string user)
{
try
{
List