|  |  |  | 
|---|
|  |  |  | string sql = sql1 + sWhere + "order by HItemID desc"; | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sql, "h_v_IF_DepartmentList"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ds == null || ds.Tables[0].Rows.Count == 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "false!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "Sucess!"; | 
|---|
|  |  |  | objJsonResult.data = ds.Tables[0]; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "Sucess!"; | 
|---|
|  |  |  | objJsonResult.data = ds.Tables[0]; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | [HttpPost] | 
|---|
|  |  |  | public object AddBill([FromBody] JObject oMain) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var _value = oMain["oMain"].ToString(); | 
|---|
|  |  |  | string msg1 = _value.ToString(); | 
|---|
|  |  |  | //反序列化 | 
|---|
|  |  |  | 
|---|
|  |  |  | DAL.ClsGy_Department_Ctl oDept = new DAL.ClsGy_Department_Ctl(); | 
|---|
|  |  |  | DAL.ClsGy_Department_View oDeptHlp = new DAL.ClsGy_Department_View(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Department> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Department>>(msg1); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | //objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch(Exception e) | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | oCN.RollBack(); | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | 
|---|
|  |  |  | string msg1 = _value.ToString(); | 
|---|
|  |  |  | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); | 
|---|
|  |  |  | string msg2 = sArray[0].ToString(); | 
|---|
|  |  |  | //string msg3 = sArray[1].ToString(); | 
|---|
|  |  |  | string msg3 = sArray[1].ToString(); | 
|---|
|  |  |  | //string msg4 = sArray[2].ToString(); | 
|---|
|  |  |  | //string msg5 = sArray[3].ToString(); | 
|---|
|  |  |  | //反序列化 | 
|---|
|  |  |  | 
|---|
|  |  |  | ",HLevel,HEndFlag,HStopflag,HRemark,HEmpID,HBarCodeForBase,HEntityID,HUSEORGID) " + | 
|---|
|  |  |  | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + | 
|---|
|  |  |  | "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HEmpID + ",'" + HBarCode + "'" + | 
|---|
|  |  |  | "," + HEntityID.ToString() +","+ HUseOrgID + ")", ref DBUtility.ClsPub.sExeReturnInfo); | 
|---|
|  |  |  | "," + HEntityID.ToString() + "," + HUseOrgID + ")", ref DBUtility.ClsPub.sExeReturnInfo); | 
|---|
|  |  |  | //修改上级为非末级代码 | 
|---|
|  |  |  | oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); | 
|---|
|  |  |  | oCN.Commit(); | 
|---|