//修改
        public ActionResult UpdateUserType(int UserTypeID, string UserType, string Describe, Array XinZengshuzu, Array ShanChushuzu)
        {
            try
            {
                //声明字符串获取新增数组
                string   x    = ((string[])XinZengshuzu)[0];
                string[] intx = x.Split(',');
                //声明字符串获取删除数组
                string   s    = ((string[])ShanChushuzu)[0];
                string[] ints = s.Split(',');
                //声明权限表
                B_Jurisdictio modelsJurisdiction = new B_Jurisdictio();
                for (int i = 0; i < intx.Length; i++)
                {
                    if (intx[i] != "")
                    {
                        modelsJurisdiction.UserTypeID      = UserTypeID;
                        modelsJurisdiction.ModularDetailID = Convert.ToInt32(intx[i]);
                        myDYXTEntities.B_Jurisdictio.Add(modelsJurisdiction);
                        myDYXTEntities.SaveChanges();
                    }
                }
                for (int i = 0; i < ints.Length; i++)
                {
                    if (ints[i] != "")
                    {
                        Delete(UserTypeID, Convert.ToInt32(ints[i]));
                    }
                }
                var db = (from tb in myDYXTEntities.S_UserTypeTable
                          where tb.UserTypeID == UserTypeID
                          select new
                {
                    tb.ToVoidNo,
                    tb.FoundTime,
                }).ToList();
                S_UserTypeTable modelUserType = new S_UserTypeTable();
                modelUserType.UserTypeID   = UserTypeID;
                modelUserType.UserTypeName = UserType.Trim();
                modelUserType.Describe     = Describe.Trim();
                modelUserType.FoundTime    = db[0].FoundTime;
                modelUserType.ToVoidNo     = db[0].ToVoidNo;

                myDYXTEntities.Entry(modelUserType).State = EntityState.Modified;
                myDYXTEntities.SaveChanges();


                return(Json("success", JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json("failed", JsonRequestBehavior.AllowGet));
            }
        }
        //新增
        public ActionResult InsertUserType(string Name, string Describe, Array MoKuaiMingXiiiD)
        {
            try
            {
                //声明字符串接收模块明细信息数组的信息
                string z = ((string[])MoKuaiMingXiiiD)[0];
                //声明字符串数组接收模块明细信息数据
                string[] ints = z.Split(',');
                //实例化用户类型表   新增数据
                S_UserTypeTable modelsUserType = new S_UserTypeTable();
                modelsUserType.UserTypeName = Name.Trim();
                modelsUserType.Describe     = Describe.Trim();
                modelsUserType.FoundTime    = DateTime.Now.ToString();
                modelsUserType.ToVoidNo     = false;
                //modelsUserType.typeClass = Session["UserTypeClass"].ToString().Trim();
                myDYXTEntities.S_UserTypeTable.Add(modelsUserType);
                myDYXTEntities.SaveChanges();

                //获取新增的用户类型ID
                var XinZengID = modelsUserType.UserTypeID;
                //实例化权限表
                B_Jurisdictio modelsJurisdiction = new B_Jurisdictio();
                for (int d = 0; d < ints.Length; d++)
                {
                    modelsJurisdiction.ModularDetailID = Convert.ToInt32(ints[d]);
                    modelsJurisdiction.UserTypeID      = XinZengID;
                    myDYXTEntities.B_Jurisdictio.Add(modelsJurisdiction);
                    myDYXTEntities.SaveChanges();
                }
                return(Json("success", JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json("failed", JsonRequestBehavior.AllowGet));
            }
        }