| | |
| | | { |
| | | string ModRightNameCheck = "Xs_SeOrderBill_Close"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //检查权限 |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未关闭!不需要反关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //判断单据是否为自动关闭 |
| | | sql = "select * from Xs_SeOrderBillMain where HInterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "Xs_SeOrderBillMain"); |
| | | if (ds.Tables[0].Rows[0]["HCloseType"].ToString() == "False") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反关闭失败!单据为自动关闭,不能进行手动反关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "行未关闭!不需要再行反关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //判断行是否为自动关闭 |
| | | string temp = ds.Tables[0].Rows[0]["HCloseType"].ToString(); |
| | | if (ds.Tables[0].Rows[0]["HCloseType"].ToString() == "False") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "行反关闭失败!行为自动关闭,不能进行手动反关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | } |
| | | 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() + ")"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //sWhere = " and 1=1 "; |
| | | sWhere = " and HCusID in (select hcusid from Gy_UserCustomerRelation Where HUserID = '" + CurUserID + "') "; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |