| | |
| | | |
| | | #region å
¬ç¨æ¹æ³ |
| | | |
| | | #region è´¦å·ç»å
¥ |
| | | |
| | | /// <summary> |
| | | /// è´¦å·ç»å
¥æ¶éªè¯è´¦å·ãå¯ç ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetUser_Json")] |
| | | [HttpGet] |
| | | public object GetUser_Json(string HUserNumber, string HPassWord, Int64 HStockOrgID, string HStockOrgName) |
| | | { |
| | | try |
| | | { |
| | | HPassWord = DBUtility.ClsPub.StrToPsd(HPassWord.Trim()); |
| | | ds = oCn.RunProcReturn("exec h_p_Gy_User '" + HUserNumber + "','" + HPassWord + "'," + HStockOrgID.ToString(), "h_p_Gy_User"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è¾å
¥çç¨æ·åæå¯ç é误ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | //å¤æç¨æ·å¯¹åºç»ç»æéï¼å¾å°ç»å
¥ç»ç»ä¿¡æ¯ï¼IDã代ç ãåç§°ï¼ |
| | | DataSet ds2 = oWebs.get_ORGANIZATIONS_UserByOrgRelation(HUserNumber, HStockOrgName); |
| | | if (ds2 == null || ds2.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å¤æç¨æ·å¯¹åºç»ç»æéé误ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HBack"])==1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å¤æç¨æ·è´¦å·å¯ç ï¼WISEãCLOUDï¼æ¯å¦æ£ç¡® |
| | | if (!oWebs.CheckUser(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["Czymc"]), ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //å¤±è´¥ï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ç»å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç»å½å¼å¸¸ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region è·åæå¤§åæ®IDãåæ®å· |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetSupplier_Json")] |
| | | [HttpGet] |
| | | public object GetSupplier_Json(Int64 HSupID) |
| | | public object GetSupplier_Json(string HBarCode, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HItemID=" + HSupID.ToString(), "Gy_Supplier"); |
| | | Int64 HSupID = 0; |
| | | HSupID = DBUtility.ClsPub.isLong(HBarCode); |
| | | ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HItemID=" + HSupID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Supplier"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼è¯·ç¡®è®¤ææ«ä¾åºåæ¡ç æ¯å¦æ£ç¡®ï¼ä¸ä¸ºéç¦ç¨ç¶æï¼"; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼è¯·ç¡®è®¤ææ«ä¾åºåæ¡ç æ¯å¦å±äºè¯¥ç»ç»ï¼ä¸ä¸ºéç¦ç¨ç¶æï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è¿åä¾åºåä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä¾åºååè¡¨ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetSupplierList_Json")] |
| | | [HttpGet] |
| | | public object GetSupplierList_Json(string Supplier, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%')", "Gy_Supplier"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½ä¾åºåè®°å½ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetCustomer_Json")] |
| | | [HttpGet] |
| | | public object GetCustomer_Json(Int64 HCusID) |
| | | public object GetCustomer_Json(string HBarCode, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HItemID=" + HCusID.ToString(), "Gy_Customer"); |
| | | Int64 HCusID = 0; |
| | | HCusID = DBUtility.ClsPub.isLong(HBarCode); |
| | | ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HItemID=" + HCusID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Customer"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼è¯·ç¡®è®¤ææ«å®¢æ·æ¡ç æ¯å¦æ£ç¡®ï¼ä¸ä¸ºéç¦ç¨ç¶æï¼"; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼è¯·ç¡®è®¤ææ«å®¢æ·æ¡ç æ¯å¦å±äºè¯¥ç»ç»ï¼ä¸ä¸ºéç¦ç¨ç¶æï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |