using BizCom; using System; using System.Collections.Generic; using System.Data; namespace SiteCore.Handler { public partial class sync { //账单导入接口 public void get_erp_zhangdan() { DataStruct dStruct = GetPostStruct(); List lw = new List(); string tid = GetPostString("tid"); if (tid.Length > 0) lw.Add(string.Format("tid like '%{0}%'", tid)); string shopName = GetPostString("shopName"); if (shopName.Length > 0) lw.Add(string.Format("shopName like '%{0}%'", shopName)); string batchNo = GetPostString("batchNo"); if (batchNo.Length > 0) lw.Add(string.Format("batchNo like '%{0}%'", batchNo)); string supplierName = GetPostString("supplierName"); if (supplierName.Length > 0) lw.Add(string.Format("ComName like '%{0}%'", supplierName)); string logistics = GetPostString("logistics"); if (logistics.Length > 0) lw.Add(string.Format("logistics like '%{0}%'", logistics)); string state = GetPostString("state"); if (state.Length > 0) lw.Add(string.Format("state = {0}", state)); string date1 = GetPostString("date1"); if (date1.Length > 0) lw.Add(string.Format("importDate >= '{0}'", date1)); string date2 = GetPostString("date2"); if (date2.Length > 0) lw.Add(string.Format("importDate <= '{0}'", date2)); string price1 = GetPostString("price1"); if (price1.Length > 0) lw.Add(string.Format("total >= {0}", price1)); string price2 = GetPostString("price2"); if (price2.Length > 0) lw.Add(string.Format("total <= {0}", price2)); string unusual = GetPostString("unusual"); if (unusual.Length > 0) lw.Add(string.Format("unusual like '%{0}%'", unusual)); dStruct.Order = "tid desc"; dStruct.MainWhere = string.Join(" and ", lw.ToArray()); DataTable dt = WebCache.GetData("view_ZhangDan", dStruct); writeGridDataTableJson(dStruct.TotalCount, dt); } public void del_erp_zhangdan() { if (UrlPostParmsCheck("eid")) { int eid = GetPostInt("eid"); CeErpShop.Del(eid); returnSuccessMsg("删除成功"); } } public void save_erp_zhangdan() { if (UrlPostParmsCheck("shopname,user")) { int eid = GetPostInt("eid"); CeErpShop entity = null; if (eid > 0) entity = CeErpShop.Get(eid); else entity = new CeErpShop(); entity.UserID = GetPostInt("user"); entity.ComName = GetPostString("ComName"); entity.AppSecret = GetPostString("AppSecret"); entity.ShopName = GetPostString("ShopName"); entity.SName = GetPostString("SName"); entity.ShopType = GetPostString("ShopType"); entity.State = GetPostInt("State"); entity.AddTime = DateTime.Now; entity.Summary = GetPostString("con"); if (eid > 0) entity.Update(); else entity.Create(); returnSuccessMsg("保存成功!"); } } //账单新增异常接口 public void save_erp_zhangdan_unusual() { if (UrlPostParmsCheck("id")) { int id = GetPostInt("id"); string unusual = GetPostString("unusual"); CeErpZhangDan entity = null; entity = CeErpZhangDan.GetById(id); if (entity != null) { entity.unusual = unusual; entity.Update(); returnSuccessMsg("异常说明保存成功!"); return; } else returnErrorMsg("找不到记录"); } } } }