| | |
| | | using Newtonsoft.Json.Linq; |
| | | using SQLHelper; |
| | | using System; |
| | | using System.Text; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.IO; |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取选单号的源单类型 通过选单号单据类型 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Web/GetHSourceBillTypeByBillType")] |
| | | [HttpGet] |
| | | public object GetHSourceBillTypeByBillType(string HBillType, int Num) |
| | | { |
| | | try |
| | | { |
| | | ClsCN oCn = new ClsCN(); |
| | | DataSet oDs = new DataSet(); |
| | | //有的单子源单分为红蓝单 0代表蓝单 1代表红单 |
| | | if (Num == 0) |
| | | { //源单为蓝单 |
| | | oDs = oCn.RunProcReturn("select * from Xt_BillSourceSet where HNumber='" + HBillType + "'and HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet"); |
| | | } |
| | | else if (Num == 1) |
| | | { //源单为红单 |
| | | oDs = oCn.RunProcReturn("select * from Xt_BillSourceSet where HNumber='" + HBillType + "' and HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet"); |
| | | } |
| | | else if (Num == 2) |
| | | { //不分红蓝单 |
| | | oDs = oCn.RunProcReturn("select * from Xt_BillSourceSet where HNumber='" + HBillType + "'", "Xt_BillSourceSet"); |
| | | } |
| | | |
| | | objjson.code = "1"; |
| | | objjson.count = 1; |
| | | objjson.Message = "获取成功!"; |
| | | objjson.data = oDs.Tables[0]; |
| | | return objjson; ; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败!异常" + e.ToString(); |
| | | objjson.data = null; |
| | | return objjson; ; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取选单号的源单类型 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | return objjson; ; |
| | | } |
| | | } |
| | | #region [从数据库加载菜单 APP] |
| | | |
| | | public class AppMenuLoad |
| | | { |
| | | public string HitemID { get; set; } // 主键 |
| | | public string HPartentID { get; set; } = "0"; // 父节点ID |
| | | public string HEntryID { get; set; } // 菜单节点id |
| | | public string HIndex { get; set; } |
| | | public string HName { get; set; } |
| | | public string HMenuName { get; set; } |
| | | public string HPicNum { get; set; } |
| | | public string HShowMode { get; set; } |
| | | public string HTranslationText_English { get; set; } |
| | | public string HTranslationText_Spain { get; set; } |
| | | public string HMaker { get; set; } |
| | | public List<MenuLoad> childMenus { get; set; } |
| | | } |
| | | [Route("Web/MenuList_APP")] |
| | | [HttpGet] |
| | | public object MenuList_APP(string HMaker, string HType, string HMenuListName) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds = oCN.RunProcReturn("exec [h_p_Gy_MenuDefineSet_APP_Get] " + |
| | | "@HMaker = N'" + HMaker + "'," + |
| | | "@HType = N'" + HType + "'," + |
| | | "@HMenuListName = N'" + HMenuListName + "'" |
| | | , "h_p_Gy_MenuDefineSet_APP_Get"); |
| | | |
| | | if ((bool)ds.Tables[0].Rows[0]["returnType"] == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString(); |
| | | objJsonResult.data = ds.Tables[1]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | |
| | | [Route("Web/SetMenuList_APP")] |
| | | [HttpPost] |
| | | public object SetMenuList_APP([FromBody] JObject oMain) |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | try |
| | | { |
| | | string msg2 = sArray[0]; |
| | | string user = sArray[1].ToString(); |
| | | string MenuName = sArray[2].ToString(); |
| | | string type = sArray[3].ToString(); |
| | | |
| | | if (String.Equals(type, "APP", StringComparison.InvariantCultureIgnoreCase)) |
| | | { |
| | | oCN.BeginTran(); |
| | | List<AppMenuLoad> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AppMenuLoad>>(msg2); |
| | | string sql1 = "delete from Gy_MenuDefineSet_APP where HMenuName = '" + MenuName + "' and HMaker = '" + user + "'"; |
| | | oCN.RunProcReturn(sql1, "Gy_MenuDefineSet_APP"); |
| | | list.ForEach(one => |
| | | { |
| | | string sql2 = "insert into Gy_MenuDefineSet_APP( HEntryID, HIndex, HName, HMenuName, HPicNum, HShowMode, HMaker)" + |
| | | "Values('" + one.HEntryID + "','" + one.HIndex + "','" + one.HName + "','" + MenuName + "','" |
| | | + one.HPicNum + "','" + one.HShowMode + "','" + user + "')"; |
| | | oCN.RunProcReturn(sql2, "Gy_MenuDefineSet_APP"); |
| | | }); |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "设置成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "暂不支持该平台设置自定义菜单!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region [从数据库加载菜单] |
| | | public class MenuLoad |