You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.1 KiB

1 year ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CK.SCP.Models;
using CK.SCP.Models.ScpEntity;
namespace CK.SCP.Controller
{
public class PODetailController
{
public static V_POAllDetail GetlistByBillNum(string billnum)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.V_POAllDetail.SingleOrDefault(p => p.BillNum == billnum);
}
}
public static TA_VENDER GetlistBySupplierCode(string VendId)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TA_VENDER.SingleOrDefault(p => p.VendId == VendId);
}
}
public static List<TF_PO_DETAIL> GetDetaillistByBillNum(string billnum)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TF_PO_DETAIL.Where(p => p.BillNum == billnum).ToList();
}
}
public static TF_PO_DETAIL GetDetaillistByuid(int uid)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TF_PO_DETAIL.SingleOrDefault(p => p.UID == uid);
}
}
public static List<TF_PO_DETAIL> GetDetaillistBybillnos(string billno)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TF_PO_DETAIL.Where(p => p.BillNum == billno).ToList();
}
}
public static void Delete(TF_PO_DETAIL model)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
db.TF_PO_DETAIL.Remove(model);
}
}
public static TF_PO_DETAIL GetDetaillistBybillidandline(string bill, int linenum)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.TF_PO_DETAIL.SingleOrDefault(p => p.BillNum == bill && p.ErpLineNum == linenum);
}
}
}
}