Example #1
0
        public string Data(int page             = 1, int rows = 15,
                           string productname   = null,
                           string stockname     = null,
                           string productnumber = null,
                           string wdr           = null,
                           string batchno       = null,
                           string brand         = null,
                           string mode          = null,
                           string colorno       = null)
        {
            if (!string.IsNullOrEmpty(brand) && (!string.IsNullOrEmpty(productname) || !string.IsNullOrEmpty(mode) || !string.IsNullOrEmpty(stockname) || !string.IsNullOrEmpty(colorno)))
            {
                int pagecount = 0;
                APIService.APIServiceClient api = new APIService.APIServiceClient();
                DataTable table = api.WmStock(
                    out pagecount,
                    productnumber,
                    productname,
                    stockname,
                    brand,
                    batchno,
                    wdr,
                    mode,
                    colorno,
                    rows,
                    page, true, false);

                return(JSONhelper.FormatJSONForEasyuiDataGrid(pagecount, table));
            }
            return(null);
        }
Example #2
0
        public string SRCData(string itemid = null, string ICPRBILLNO = null, string FICPRENTRYID = null, string FSTOCK = null)
        {
            List <object> list = new List <object>();

            List <string> srcnumbers = new List <string>();
            var           srclist    = SRCDal.Instance.GetWhere(new { FPRODUCTID = itemid }).ToList();

            foreach (var model in srclist)
            {
                srcnumbers.Add(model.FSRCCODE);
            }
            int pagecount = 0;

            APIService.APIServiceClient api = new APIService.APIServiceClient();
            DataTable table = api.WmStock(out pagecount, string.Join(",", srcnumbers.ToArray()), "", FSTOCK, "", "", "", "", "", 1000, 1, true, false);

            foreach (var model in srclist)
            {
                var query = table.AsEnumerable().Where <DataRow>(m => m["FNumber"].ToString() == model.FSRCCODE);
                foreach (var row in query)
                {
                    list.Add(new
                    {
                        FID          = model.FID,
                        FPRODUCTID   = model.FPRODUCTID,
                        FSRCNAME     = model.FSRCNAME,
                        FSRCCODE     = model.FSRCCODE,
                        FSRCMODEL    = model.FSRCMODEL,
                        FSRCUNIT     = model.FUNIT,
                        FORDERUNIT   = model.FORDERUNIT,
                        FRATE        = model.FRATE,
                        FBATCHNO     = row["FBatchNo"],
                        FCOLORNO     = row["FColorNo"],
                        FSTOCK       = row["FStockName"],
                        FSTOCKPLACE  = row["FSPName"],
                        FQTY         = row["FBasicQty"],
                        FLEVEL       = row["FGrade"],
                        FWDR         = row["FWDRID"],
                        FCOMMITQTY   = System.DBNull.Value,
                        FHNAMOUNT    = 0,
                        ICPRBILLNO   = ICPRBILLNO,
                        FICPRENTRYID = FICPRENTRYID,
                        FREMARK      = ""
                    });
                }
            }

            return(JSONhelper.FormatJSONForEasyuiDataGrid(list.Count, list));
        }