Ejemplo n.º 1
0
        /// <summary>
        /// 添加人员功能权限数据
        /// </summary>
        /// <returns></returns>
        private string AddData()
        {
            string msg = string.Empty;

            string gnid = Request["gns"];
            string ghs  = Request["ghs"];

            string[] arrghs = ghs.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            string[] arrgns = gnid.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            List <EDRS.Model.XT_QX_RYGNFP> modelList = new List <EDRS.Model.XT_QX_RYGNFP>();

            string where = string.Empty;

            string wghs   = string.Empty;
            string wgnbms = string.Empty;

            for (int j = 0; j < arrgns.Length; j++)
            {
                for (int i = 0; i < arrghs.Length; i++)
                {
                    EDRS.Model.XT_QX_RYGNFP model = new EDRS.Model.XT_QX_RYGNFP();
                    model.DWBM = UserInfo.DWBM;
                    model.GH   = arrghs[i];
                    model.GNBM = arrgns[j];
                    model.BMBM = "0   ";
                    //model.GNCS = "";
                    model.BZ = "";
                    modelList.Add(model);
                    if (j == 0)
                    {
                        wghs += "'" + arrghs[i] + "'";
                        if (i < arrghs.Length - 1)
                        {
                            wghs += ",";
                        }
                    }
                }
                wgnbms += "'" + arrgns[j] + "'";
                if (j < arrgns.Length - 1)
                {
                    wgnbms += ",";
                }
            }
            EDRS.BLL.XT_QX_RYGNFP          bll        = new EDRS.BLL.XT_QX_RYGNFP(this.Request);
            List <EDRS.Model.XT_QX_RYGNFP> modelList2 = bll.GetModelList(" and DWBM = '" + UserInfo.DWBM + "' and GH in (" + wghs + ") and GNBM in (" + wgnbms + ")");

            List <EDRS.Model.XT_QX_RYGNFP> modelList3 = modelList.Except(modelList2, new XT_QX_RYGNFPListEquality()).ToList();

            if (modelList3.Count == 0 || bll.AddList(modelList3))
            {
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.功能权限管理Web, "添加人员功能权限成功", "工号:" + ghs, UserInfo, UserRole, this.Request);
                return(ReturnString.JsonToString(Prompt.win, "保存成功", null));
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.功能权限管理Web, "添加人员功能权限失败", "工号:" + ghs, UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "保存失败", null));
        }
Ejemplo n.º 2
0
        public static string GetQxByRyid(string ghid)
        {
            ghid = ghid.Replace("[", "").Replace("]", "").Replace("\"", "");


            var sbwhere = new StringBuilder();

            var ghids = ghid.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            if (ghids.Length == 0)
            {
                return("");
            }
            var objectValues = new object[ghids.Length];
            var blljsgnfp    = new EDRS.BLL.XT_QX_RYGNFP(request);

            for (var i = 0; i < ghids.Length; i++)
            {
                if (i == 0)
                {
                    sbwhere.Append(" and (GH=:GH ");
                }
                else
                {
                    sbwhere.Append("  GH=:GH" + i);
                }

                objectValues[i] = ghids[i];

                if (i < ghids.Length - 1)
                {
                    sbwhere.Append(" or ");
                }
                if (i == ghids.Length - 1)
                {
                    sbwhere.Append(" ) ");
                }
            }

            var list = blljsgnfp.GetModelList(sbwhere.ToString(), objectValues);

            var listgnid = list.Select(xtQxRygnfp => xtQxRygnfp.GNBM).ToList();


            var str = JsonHelper.JsonString(listgnid);

            return(str);
        }