Esempio n. 1
0
    public string getWaitOrderList(string vendor, string plant_code)
    {
        Vp_purchase_orders conf = new Vp_purchase_orders();

        if (!string.IsNullOrEmpty(vendor))
        {
            conf.Vendor = vendor;

            Vp_users conf2 = new Vp_users();
            conf2.Vendor = vendor;
            Vp_users valObj = BLLTable <Vp_users> .Factory("conn_gys").GetRowData(conf2);

            if (valObj == null)
            {
                return("");
            }
        }
        else
        {
            List <string> vendors  = new List <string>();
            Vp_users      userCond = new Vp_users();
            Vp_users      userVal  = new Vp_users();
            userVal.Vendor = "";
            List <Vp_users> users = BLLTable <Vp_users> .Factory("conn_gys").Select(userVal, userCond);

            foreach (Vp_users u in users)
            {
                vendors.Add(u.Vendor);
            }
            conf.In(Vp_purchase_orders.Attribute.Vendor, vendors.ToArray());
        }
        if (!string.IsNullOrEmpty(plant_code))
        {
            conf.Plant_code = plant_code;
        }
        conf.af_WhereSQL += " AND (status='REL' OR status='VCO' OR status='CCO')";
        conf.OrderBy("release_date desc");

        List <Vp_purchase_orders> orderList = BLLTable <Vp_purchase_orders> .Factory("conn_gys").Select(new Vp_purchase_orders(), conf);

        string xml = XmlUtil.getXmlByTableList(orderList, new Vp_purchase_orders().TableName());

        //string json=JsonUtil.getJsonStr<V_PURSUEDELIVER>(list);
        return(xml);
    }
    public string getWaitOrderList(string vendor,string plant_code)
    {
        Vp_purchase_orders conf = new Vp_purchase_orders();
        if (!string.IsNullOrEmpty(vendor))
        {
            conf.Vendor = vendor;

            Vp_users conf2 = new Vp_users();
            conf2.Vendor = vendor;
            Vp_users valObj = BLLTable<Vp_users>.Factory("conn_gys").GetRowData(conf2);
            if (valObj == null)
            {
                return "";
            }
        }
        else {
            List<string> vendors = new List<string>();
            Vp_users userCond = new Vp_users();
            Vp_users userVal = new Vp_users();
            userVal.Vendor = "";
            List<Vp_users> users = BLLTable<Vp_users>.Factory("conn_gys").Select(userVal, userCond);
            foreach (Vp_users u in users)
            {
                vendors.Add(u.Vendor);
            }
            conf.In(Vp_purchase_orders.Attribute.Vendor, vendors.ToArray());
        }
            if (!string.IsNullOrEmpty(plant_code))
            {
                conf.Plant_code = plant_code;
            }
            conf.af_WhereSQL += " AND (status='REL' OR status='VCO' OR status='CCO')";
            conf.OrderBy("release_date desc");

            List<Vp_purchase_orders> orderList = BLLTable<Vp_purchase_orders>.Factory("conn_gys").Select(new Vp_purchase_orders(), conf);

            string xml = XmlUtil.getXmlByTableList(orderList, new Vp_purchase_orders().TableName());
            //string json=JsonUtil.getJsonStr<V_PURSUEDELIVER>(list);
            return xml;
    }