yusijie
2022-11-15 2bd6029f916c35a723588dec2c07d0497d6a4dfc
WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs
@@ -75,6 +75,48 @@
                return objJsonResult;
            }
        }
        /// <summary>
        /// 根据基础资料ID 查找记录
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xt_ORGANIZATIONS/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_IF_ORGANIZATIONSList where HitemID=" + HInterID, "h_v_IF_ORGANIZATIONSList");
                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;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 新增单据-保存按钮
        ///参数:string sql。
@@ -175,7 +217,11 @@
                string HRemark = list[0].HRemark;
                bool HStopflag = list[0].HStopflag;
                int ChangeHStopflag = 0;
                if (HStopflag)
                {
                    ChangeHStopflag = 1;
                }
                //判断权限
                if (!ClsPub.Security_Log("Gy_WorkCenter_Edit", 1, false, msg3))
                {
@@ -212,12 +258,12 @@
                    " (HNumber,HName,HParentID" +
                   ",HStopflag,HMakeTime" +
                   ",HRemark) " +
                   " Values('" + HNumber + "','" + HName + "'," + HParentID.ToString() +
                   "," + HStopflag + "getdate()" +
                   " Values('" + HNumber + "','" + HName + "','" + HParentID.ToString() +
                   "','" + ChangeHStopflag + "'," + "getdate()" +
                   ",'" + HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改上级为非末级代码
                    //oCN.RunProc("Update Xt_ORGANIZATIONS set HStopflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                    oCN.RunProc("Update Xt_ORGANIZATIONS set HStopflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                    oCN.Commit();
                }
                else
@@ -243,7 +289,7 @@
            }
            catch (Exception e)
            {
                oCN.RollBack();
                //oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.Message;
@@ -252,7 +298,7 @@
            }
        }
        /// <summary>
        /// 职员设置删除功能
        /// 组织设置删除功能
        /// </summary>
        /// <returns></returns>
        [Route("DeltetXt_ORGANIZATIONSList")]
@@ -284,7 +330,7 @@
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONSList where HItemID=" + HItemID, "Xt_ORGANIZATIONSList");
                ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where HItemID=" + HItemID, "Xt_ORGANIZATIONS");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -304,7 +350,7 @@
                    return objJsonResult;
                }
                oCN.RunProc("update Xt_ORGANIZATIONSList set HStopflag=1 where HItemID=" + HItemID);
                oCN.RunProc("delete from Xt_ORGANIZATIONS where HItemID=" + HItemID);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;