duhe
2024-01-17 6c9181928f303f025740e89002f25bcead9303d4
WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -1914,29 +1914,29 @@
                }
                else
                {
                    //string sql = "select * from Gy_UserCustomerRelation where HUserID = '" + CurUserID + "'";
                    //ds = oCN.RunProcReturn(sql, "Gy_UserCustomerRelation");
                    //if (ds == null || ds.Tables[0].Rows.Count == 0)
                    //{
                    //    sWhere = " and 1 = 0";
                    //}
                    //else
                    //{
                    //    sWhere = " and HCusID in (";
                    //    for(var i = 0; i < ds.Tables[0].Rows.Count; i++)
                    //    {
                    //        if (i < ds.Tables[0].Rows.Count - 1)
                    //        {
                    //            sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ",";
                    //        }
                    //        else
                    //        {
                    //            sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ")";
                    //        }
                    //    }
                    //}
                    string sql = "select * from Gy_UserCustomerRelation where HUserID = '" + CurUserID + "'";
                    ds = oCN.RunProcReturn(sql, "Gy_UserCustomerRelation");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        sWhere = " and 1 = 0";
                    }
                    else
                    {
                        sWhere = " and HCusID in (";
                        for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            if (i < ds.Tables[0].Rows.Count - 1)
                            {
                                sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ",";
                            }
                            else
                            {
                                sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ")";
                            }
                        }
                    }
                    sWhere = " and 1=1 ";
                    //sWhere = " and 1=1 ";
                }
                objJsonResult.code = "1";
@@ -2133,5 +2133,42 @@
            }
        }
        #endregion
        #region 销售订单 根据主内码与子内码获取销售订单数据
        [Route("Xs_SeOrderBill/loadXs_SeOrderBill_Push")]
        [HttpGet]
        public object loadXs_SeOrderBill_Push(long HInterID,long HSubID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_SeOrderBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到源单信息!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}