Ejemplo n.º 1
0
 public SearchResult SearchProductBOM(Sender sender, SearchProductBOMArgs args)
 {
     try
     {
         using (ObjectProxy op = new ObjectProxy())
         {
             return(op.SearchProductBOM(args));
         }
     }
     catch (Exception ex)
     {
         PLogger.LogError(ex);
         throw ex;
     }
 }
Ejemplo n.º 2
0
        public void List()
        {
            try
            {
                using (ProxyBE p = new ProxyBE())
                {
                    SearchProductBOMArgs args = new SearchProductBOMArgs();
                    if (!string.IsNullOrEmpty(parm.BOMID))
                    {
                        args.BOMID = parm.BOMID;
                    }
                    if (!string.IsNullOrEmpty(parm.ProductCode))
                    {
                        args.ProductCode = parm.ProductCode;
                    }
                    if (!string.IsNullOrEmpty(parm.ProductName))
                    {
                        args.ProductName = parm.ProductName;
                    }
                    if (!string.IsNullOrEmpty(Request["Status"]))
                    {
                        args.Status = Convert.ToBoolean(Request["Status"]);
                    }
                    if (!string.IsNullOrEmpty(Request["CreatedFrom"]))
                    {
                        args.CreatedFrom = parm.CreatedFrom;
                    }
                    if (!string.IsNullOrEmpty(Request["CreatedTo"]))
                    {
                        args.CreatedTo = parm.CreatedTo.AddDays(1);
                    }
                    args.OrderBy       = string.IsNullOrEmpty(pagingParm.SortOrder.Trim()) ? "ID" : pagingParm.SortOrder;
                    args.RowNumberFrom = pagingParm.RowNumberFrom;
                    args.RowNumberTo   = pagingParm.RowNumberTo;
                    //Where

                    SearchResult sr = p.Client.SearchProductBOM(SenderUser, args);
                    Response.Write(JSONHelper.Dataset2Json(sr.DataSet));
                }
            }
            catch (Exception ex)
            {
                WriteError(ex.Message, ex);
            }
        }