예제 #1
0
        public bool AddDept(RoadFlow.Data.Model.Organize organize)
        {
            if (organize.IntID == 0)
            {
                organize = new RoadFlow.Platform.Organize().Get(organize.ID);
            }
            int num = 1;

            if (!organize.ParentID.IsEmptyGuid())
            {
                RoadFlow.Data.Model.Organize organize2 = new RoadFlow.Platform.Organize().Get(organize.ParentID);
                if (organize2 != null)
                {
                    num = organize2.IntID;
                }
            }
            string   url      = "https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token=" + GetAccessToken();
            string   text     = "{\"name\":\"" + replaceName(organize.Name) + "\",\"parentid\":" + num.ToString() + ",\"order\":" + organize.Sort.ToString() + ",\"id\":" + organize.IntID.ToString() + "}";
            string   text2    = HttpHelper.SendPost(url, text);
            JsonData jsonData = JsonMapper.ToObject(text2);
            bool     flag     = jsonData.ContainsKey("errcode") && jsonData["errcode"].ToString().ToInt() == 0;

            Log.Add("调用了微信添加部门-" + organize.Name + "-" + (flag ? "成功" : "失败"), "返回:" + text2, Log.Types.微信企业号, organize.Serialize(), text);
            return(flag);
        }
예제 #2
0
        public bool EditUser(RoadFlow.Data.Model.Users user)
        {
            if (user.Mobile.IsNullOrEmpty() && user.Email.IsNullOrEmpty() && user.WeiXin.IsNullOrEmpty())
            {
                return(false);
            }
            if (GetUser(user.Account).IsNullOrEmpty())
            {
                return(AddUser(user));
            }
            string url = "https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=" + GetAccessToken();
            List <RoadFlow.Data.Model.UsersRelation> allByUserID = new UsersRelation().GetAllByUserID(user.ID);

            RoadFlow.Platform.Organize organize = new RoadFlow.Platform.Organize();
            StringBuilder stringBuilder         = new StringBuilder();

            foreach (RoadFlow.Data.Model.UsersRelation item in allByUserID)
            {
                RoadFlow.Data.Model.Organize organize2 = organize.Get(item.OrganizeID);
                if (organize2 != null)
                {
                    stringBuilder.Append(organize2.IntID);
                    stringBuilder.Append(",");
                }
            }
            string   text     = "{\"userid\":\"" + user.Account + "\",\"name\":\"" + replaceName(user.Name) + "\",\"department\":[" + stringBuilder.ToString().TrimEnd(',') + "],\"position\":\"\",\"mobile\":\"" + user.Mobile + "\"," + (user.Sex.HasValue ? ("\"gender\":\"" + (user.Sex.Value + 1).ToString() + "\",") : "") + "\"email\":\"" + user.Email + "\",\"weixinid\":\"" + user.WeiXin + "\",\"enable\":" + ((user.Status == 0) ? 1 : 0).ToString() + "}";
            string   text2    = HttpHelper.SendPost(url, text);
            JsonData jsonData = JsonMapper.ToObject(text2);
            bool     flag     = jsonData.ContainsKey("errcode") && jsonData["errcode"].ToString().ToInt() == 0;

            Log.Add("调用了微信修改人员-" + user.Name + "-" + (flag ? "成功" : "失败"), "返回:" + text2, Log.Types.微信企业号, user.Serialize(), text);
            return(flag);
        }
예제 #3
0
        private List <RoadFlow.Data.Model.Organize> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.Organize> list = new List <RoadFlow.Data.Model.Organize>();

            RoadFlow.Data.Model.Organize organize = null;
            while (((DbDataReader)dataReader).Read())
            {
                organize              = new RoadFlow.Data.Model.Organize();
                organize.ID           = ((DbDataReader)dataReader).GetString(0).ToGuid();
                organize.Name         = ((DbDataReader)dataReader).GetString(1);
                organize.Number       = ((DbDataReader)dataReader).GetString(2);
                organize.Type         = ((DbDataReader)dataReader).GetInt32(3);
                organize.Status       = ((DbDataReader)dataReader).GetInt32(4);
                organize.ParentID     = ((DbDataReader)dataReader).GetString(5).ToGuid();
                organize.Sort         = ((DbDataReader)dataReader).GetInt32(6);
                organize.Depth        = ((DbDataReader)dataReader).GetInt32(7);
                organize.ChildsLength = ((DbDataReader)dataReader).GetInt32(8);
                if (!((DbDataReader)dataReader).IsDBNull(9))
                {
                    organize.ChargeLeader = ((DbDataReader)dataReader).GetString(9);
                }
                if (!((DbDataReader)dataReader).IsDBNull(10))
                {
                    organize.Leader = ((DbDataReader)dataReader).GetString(10);
                }
                if (!((DbDataReader)dataReader).IsDBNull(11))
                {
                    organize.Note = ((DbDataReader)dataReader).GetString(11);
                }
                organize.IntID = ((DbDataReader)dataReader).GetInt32(12);
                list.Add(organize);
            }
            return(list);
        }
예제 #4
0
        public int DeleteAndAllChilds(Guid orgID)
        {
            int num = 0;

            using (TransactionScope transactionScope = new TransactionScope())
            {
                UsersRelation usersRelation = new UsersRelation();
                Users         users         = new Users();
                List <RoadFlow.Data.Model.Organize> allChilds = GetAllChilds(orgID);
                List <string> list = new List <string>();
                List <RoadFlow.Data.Model.Organize> list2 = new List <RoadFlow.Data.Model.Organize>();
                foreach (RoadFlow.Data.Model.Organize item in allChilds)
                {
                    foreach (RoadFlow.Data.Model.UsersRelation item2 in usersRelation.GetAllByOrganizeID(item.ID).FindAll((RoadFlow.Data.Model.UsersRelation p) => p.IsMain == 1))
                    {
                        RoadFlow.Data.Model.Users users2 = users.Get(item2.UserID);
                        usersRelation.Delete(item2.UserID, item2.OrganizeID);
                        num += users.Delete(item2.UserID);
                        if (users2 != null)
                        {
                            list.Add(users2.Account);
                        }
                    }
                    num += Delete(item.ID);
                    list2.Add(item);
                }
                foreach (RoadFlow.Data.Model.UsersRelation item3 in usersRelation.GetAllByOrganizeID(orgID).FindAll((RoadFlow.Data.Model.UsersRelation p) => p.IsMain == 1))
                {
                    usersRelation.Delete(item3.UserID, item3.OrganizeID);
                    num += users.Delete(item3.UserID);
                    RoadFlow.Data.Model.Users users3 = users.Get(item3.UserID);
                    if (users3 != null)
                    {
                        list.Add(users3.Account);
                    }
                }
                num += Delete(orgID);
                RoadFlow.Data.Model.Organize organize = Get(orgID);
                if (organize != null)
                {
                    list2.Add(organize);
                }
                if (RoadFlow.Platform.WeiXin.Config.IsUse)
                {
                    RoadFlow.Platform.WeiXin.Organize organize2 = new RoadFlow.Platform.WeiXin.Organize();
                    if (list.Count > 0)
                    {
                        organize2.DeleteUserAsync(list.ToArray());
                    }
                    foreach (RoadFlow.Data.Model.Organize item4 in list2)
                    {
                        organize2.DeleteDeptAsync(item4.IntID);
                    }
                }
                transactionScope.Complete();
                return(num);
            }
        }
예제 #5
0
 public string GetName(Guid id)
 {
     RoadFlow.Data.Model.Organize organize = Get(id);
     if (organize != null)
     {
         return(organize.Name);
     }
     return("");
 }
예제 #6
0
 /// <summary>
 /// 更新组织
 /// </summary>
 /// <param name="organize">组织实体</param>
 public int Update(Model.Organize organize)
 {
     ClearCache();
     using (var db = new DataContext())
     {
         db.Update(organize);
         return(db.SaveChanges());
     }
 }
예제 #7
0
 public List <RoadFlow.Data.Model.Organize> GetAllChilds(Guid id)
 {
     RoadFlow.Data.Model.Organize organize = Get(id);
     if (organize == null)
     {
         return(new List <RoadFlow.Data.Model.Organize>());
     }
     return(dataOrganize.GetAllChild(organize.Number));
 }
예제 #8
0
        public string GetParentDeptLeader(Guid userID)
        {
            Guid     mainStation = GetMainStation(userID);
            Organize organize    = new Organize();

            RoadFlow.Data.Model.Organize organize2 = organize.Get(mainStation);
            if (organize2 == null)
            {
                return("");
            }
            foreach (RoadFlow.Data.Model.Organize item in organize.GetAllParent(organize2.Number))
            {
                if (!item.Leader.IsNullOrEmpty())
                {
                    return(item.Leader);
                }
            }
            return("");
        }
예제 #9
0
 public bool Move(Guid fromID, Guid toID)
 {
     RoadFlow.Data.Model.Organize organize  = Get(fromID);
     RoadFlow.Data.Model.Organize organize2 = Get(toID);
     if (organize == null || organize2 == null)
     {
         return(false);
     }
     if (organize2.Number.StartsWith(organize.Number, StringComparison.CurrentCultureIgnoreCase))
     {
         return(false);
     }
     using (TransactionScope transactionScope = new TransactionScope())
     {
         Guid parentID = organize.ParentID;
         organize.ParentID = toID;
         organize.Depth    = organize2.Depth + 1;
         organize.Number   = organize2.Number + "," + organize.ID.ToString();
         Update(organize);
         if (RoadFlow.Platform.WeiXin.Config.IsUse)
         {
             new RoadFlow.Platform.WeiXin.Organize().EditDept(organize);
         }
         foreach (RoadFlow.Data.Model.Organize item in from p in GetAllChilds(fromID)
                  orderby p.Depth
                  select p)
         {
             item.Number = Get(item.ParentID).Number + "," + item.ID.ToString();
             item.Depth  = item.Number.Split(',').Length - 1;
             Update(item);
         }
         UpdateChildsLength(toID);
         UpdateChildsLength(parentID);
         transactionScope.Complete();
         return(true);
     }
 }
예제 #10
0
        public int Add(RoadFlow.Data.Model.Organize model)
        {
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Expected O, but got Unknown
            //IL_0032: Expected O, but got Unknown
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_0050: Expected O, but got Unknown
            //IL_0051: Expected O, but got Unknown
            //IL_005e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0063: Unknown result type (might be due to invalid IL or missing references)
            //IL_006f: Expected O, but got Unknown
            //IL_0070: Expected O, but got Unknown
            //IL_007a: Unknown result type (might be due to invalid IL or missing references)
            //IL_007f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0090: Expected O, but got Unknown
            //IL_0091: Expected O, but got Unknown
            //IL_009b: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b1: Expected O, but got Unknown
            //IL_00b2: Expected O, but got Unknown
            //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d6: Expected O, but got Unknown
            //IL_00d7: Expected O, but got Unknown
            //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f7: Expected O, but got Unknown
            //IL_00f8: Expected O, but got Unknown
            //IL_0102: Unknown result type (might be due to invalid IL or missing references)
            //IL_0107: Unknown result type (might be due to invalid IL or missing references)
            //IL_0118: Expected O, but got Unknown
            //IL_0119: Expected O, but got Unknown
            //IL_0123: Unknown result type (might be due to invalid IL or missing references)
            //IL_0128: Unknown result type (might be due to invalid IL or missing references)
            //IL_0139: Expected O, but got Unknown
            //IL_013a: Expected O, but got Unknown
            //IL_0154: Unknown result type (might be due to invalid IL or missing references)
            //IL_0159: Unknown result type (might be due to invalid IL or missing references)
            //IL_0165: Expected O, but got Unknown
            //IL_0176: Unknown result type (might be due to invalid IL or missing references)
            //IL_017b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0186: Expected O, but got Unknown
            //IL_0187: Expected O, but got Unknown
            //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b2: Expected O, but got Unknown
            //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
            //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d3: Expected O, but got Unknown
            //IL_01d4: Expected O, but got Unknown
            //IL_01ea: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ef: Unknown result type (might be due to invalid IL or missing references)
            //IL_01fb: Expected O, but got Unknown
            //IL_0208: Unknown result type (might be due to invalid IL or missing references)
            //IL_020d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0218: Expected O, but got Unknown
            //IL_0219: Expected O, but got Unknown
            //IL_0224: Unknown result type (might be due to invalid IL or missing references)
            //IL_0229: Unknown result type (might be due to invalid IL or missing references)
            //IL_023a: Expected O, but got Unknown
            //IL_023b: Expected O, but got Unknown
            string sql = "INSERT INTO organize\r\n\t\t\t\t(ID,Name,Number,Type,Status,ParentID,Sort,Depth,ChildsLength,ChargeLeader,Leader,Note,IntID) \r\n\t\t\t\tVALUES(@ID,@Name,@Number,@Type,@Status,@ParentID,@Sort,@Depth,@ChildsLength,@ChargeLeader,@Leader,@Note,@IntID)";

            MySqlParameter[] obj = new MySqlParameter[13];
            MySqlParameter   val = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val).Value = model.ID;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@Name", 752, -1);

            ((DbParameter)val2).Value = model.Name;
            obj[1] = val2;
            MySqlParameter val3 = new MySqlParameter("@Number", 752, -1);

            ((DbParameter)val3).Value = model.Number;
            obj[2] = val3;
            MySqlParameter val4 = new MySqlParameter("@Type", 3, 11);

            ((DbParameter)val4).Value = model.Type;
            obj[3] = val4;
            MySqlParameter val5 = new MySqlParameter("@Status", 3, 11);

            ((DbParameter)val5).Value = model.Status;
            obj[4] = val5;
            MySqlParameter val6 = new MySqlParameter("@ParentID", 253, 36);

            ((DbParameter)val6).Value = model.ParentID;
            obj[5] = val6;
            MySqlParameter val7 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val7).Value = model.Sort;
            obj[6] = val7;
            MySqlParameter val8 = new MySqlParameter("@Depth", 3, 11);

            ((DbParameter)val8).Value = model.Depth;
            obj[7] = val8;
            MySqlParameter val9 = new MySqlParameter("@ChildsLength", 3, 11);

            ((DbParameter)val9).Value = model.ChildsLength;
            obj[8] = val9;
            _003F val10;

            if (model.ChargeLeader != null)
            {
                val10 = new MySqlParameter("@ChargeLeader", 253, 200);
                ((DbParameter)val10).Value = model.ChargeLeader;
            }
            else
            {
                val10 = new MySqlParameter("@ChargeLeader", 253, 200);
                ((DbParameter)val10).Value = DBNull.Value;
            }
            obj[9] = val10;
            _003F val11;

            if (model.Leader != null)
            {
                val11 = new MySqlParameter("@Leader", 253, 200);
                ((DbParameter)val11).Value = model.Leader;
            }
            else
            {
                val11 = new MySqlParameter("@Leader", 253, 200);
                ((DbParameter)val11).Value = DBNull.Value;
            }
            obj[10] = val11;
            _003F val12;

            if (model.Note != null)
            {
                val12 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val12).Value = model.Note;
            }
            else
            {
                val12 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val12).Value = DBNull.Value;
            }
            obj[11] = val12;
            MySqlParameter val13 = new MySqlParameter("@IntID", 3, 11);

            ((DbParameter)val13).Value = model.IntID;
            obj[12] = val13;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
예제 #11
0
        public int Update(RoadFlow.Data.Model.Organize model)
        {
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_002c: Expected O, but got Unknown
            //IL_002d: Expected O, but got Unknown
            //IL_003b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0040: Unknown result type (might be due to invalid IL or missing references)
            //IL_004c: Expected O, but got Unknown
            //IL_004d: Expected O, but got Unknown
            //IL_0056: Unknown result type (might be due to invalid IL or missing references)
            //IL_005b: Unknown result type (might be due to invalid IL or missing references)
            //IL_006c: Expected O, but got Unknown
            //IL_006d: Expected O, but got Unknown
            //IL_0076: Unknown result type (might be due to invalid IL or missing references)
            //IL_007b: Unknown result type (might be due to invalid IL or missing references)
            //IL_008c: Expected O, but got Unknown
            //IL_008d: Expected O, but got Unknown
            //IL_0098: Unknown result type (might be due to invalid IL or missing references)
            //IL_009d: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: Expected O, but got Unknown
            //IL_00af: Expected O, but got Unknown
            //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ce: Expected O, but got Unknown
            //IL_00cf: Expected O, but got Unknown
            //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ee: Expected O, but got Unknown
            //IL_00ef: Expected O, but got Unknown
            //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
            //IL_010e: Expected O, but got Unknown
            //IL_010f: Expected O, but got Unknown
            //IL_0125: Unknown result type (might be due to invalid IL or missing references)
            //IL_012a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0136: Expected O, but got Unknown
            //IL_0144: Unknown result type (might be due to invalid IL or missing references)
            //IL_0149: Unknown result type (might be due to invalid IL or missing references)
            //IL_0154: Expected O, but got Unknown
            //IL_0155: Expected O, but got Unknown
            //IL_016c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0171: Unknown result type (might be due to invalid IL or missing references)
            //IL_017d: Expected O, but got Unknown
            //IL_018b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0190: Unknown result type (might be due to invalid IL or missing references)
            //IL_019b: Expected O, but got Unknown
            //IL_019c: Expected O, but got Unknown
            //IL_01ae: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
            //IL_01bf: Expected O, but got Unknown
            //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d8: Expected O, but got Unknown
            //IL_01d9: Expected O, but got Unknown
            //IL_01e3: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f9: Expected O, but got Unknown
            //IL_01fa: Expected O, but got Unknown
            //IL_0206: Unknown result type (might be due to invalid IL or missing references)
            //IL_020b: Unknown result type (might be due to invalid IL or missing references)
            //IL_021c: Expected O, but got Unknown
            //IL_021d: Expected O, but got Unknown
            string sql = "UPDATE Organize SET \r\n\t\t\t\tName=:Name,Number1=:Number1,Type=:Type,Status=:Status,ParentID=:ParentID,Sort=:Sort,Depth=:Depth,ChildsLength=:ChildsLength,ChargeLeader=:ChargeLeader,Leader=:Leader,Note=:Note,IntID=:IntID\r\n\t\t\t\tWHERE ID=:ID";

            OracleParameter[] obj = new OracleParameter[13];
            OracleParameter   val = new OracleParameter(":Name", 126, 2000);

            ((DbParameter)val).Value = model.Name;
            obj[0] = val;
            OracleParameter val2 = new OracleParameter(":Number1", 126, 900);

            ((DbParameter)val2).Value = model.Number;
            obj[1] = val2;
            OracleParameter val3 = new OracleParameter(":Type", 112);

            ((DbParameter)val3).Value = model.Type;
            obj[2] = val3;
            OracleParameter val4 = new OracleParameter(":Status", 112);

            ((DbParameter)val4).Value = model.Status;
            obj[3] = val4;
            OracleParameter val5 = new OracleParameter(":ParentID", 126, 40);

            ((DbParameter)val5).Value = model.ParentID;
            obj[4] = val5;
            OracleParameter val6 = new OracleParameter(":Sort", 112);

            ((DbParameter)val6).Value = model.Sort;
            obj[5] = val6;
            OracleParameter val7 = new OracleParameter(":Depth", 112);

            ((DbParameter)val7).Value = model.Depth;
            obj[6] = val7;
            OracleParameter val8 = new OracleParameter(":ChildsLength", 112);

            ((DbParameter)val8).Value = model.ChildsLength;
            obj[7] = val8;
            _003F val9;

            if (model.ChargeLeader != null)
            {
                val9 = new OracleParameter(":ChargeLeader", 126, 200);
                ((DbParameter)val9).Value = model.ChargeLeader;
            }
            else
            {
                val9 = new OracleParameter(":ChargeLeader", 126, 200);
                ((DbParameter)val9).Value = DBNull.Value;
            }
            obj[8] = val9;
            _003F val10;

            if (model.Leader != null)
            {
                val10 = new OracleParameter(":Leader", 126, 200);
                ((DbParameter)val10).Value = model.Leader;
            }
            else
            {
                val10 = new OracleParameter(":Leader", 126, 200);
                ((DbParameter)val10).Value = DBNull.Value;
            }
            obj[9] = val10;
            _003F val11;

            if (model.Note != null)
            {
                val11 = new OracleParameter(":Note", 119);
                ((DbParameter)val11).Value = model.Note;
            }
            else
            {
                val11 = new OracleParameter(":Note", 119);
                ((DbParameter)val11).Value = DBNull.Value;
            }
            obj[10] = val11;
            OracleParameter val12 = new OracleParameter(":IntID", 112);

            ((DbParameter)val12).Value = model.IntID;
            obj[11] = val12;
            OracleParameter val13 = new OracleParameter(":ID", 126, 40);

            ((DbParameter)val13).Value = model.ID;
            obj[12] = val13;
            OracleParameter[] parameter = (OracleParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
예제 #12
0
        public int Add(RoadFlow.Data.Model.Organize model)
        {
            //IL_0018: Unknown result type (might be due to invalid IL or missing references)
            //IL_001d: Unknown result type (might be due to invalid IL or missing references)
            //IL_002e: Expected O, but got Unknown
            //IL_002f: Expected O, but got Unknown
            //IL_003d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0042: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Expected O, but got Unknown
            //IL_004f: Expected O, but got Unknown
            //IL_005d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0062: Unknown result type (might be due to invalid IL or missing references)
            //IL_006e: Expected O, but got Unknown
            //IL_006f: Expected O, but got Unknown
            //IL_0078: Unknown result type (might be due to invalid IL or missing references)
            //IL_007d: Unknown result type (might be due to invalid IL or missing references)
            //IL_008e: Expected O, but got Unknown
            //IL_008f: Expected O, but got Unknown
            //IL_0098: Unknown result type (might be due to invalid IL or missing references)
            //IL_009d: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: Expected O, but got Unknown
            //IL_00af: Expected O, but got Unknown
            //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d0: Expected O, but got Unknown
            //IL_00d1: Expected O, but got Unknown
            //IL_00da: Unknown result type (might be due to invalid IL or missing references)
            //IL_00df: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f0: Expected O, but got Unknown
            //IL_00f1: Expected O, but got Unknown
            //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
            //IL_0110: Expected O, but got Unknown
            //IL_0111: Expected O, but got Unknown
            //IL_011a: Unknown result type (might be due to invalid IL or missing references)
            //IL_011f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0130: Expected O, but got Unknown
            //IL_0131: Expected O, but got Unknown
            //IL_0148: Unknown result type (might be due to invalid IL or missing references)
            //IL_014d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0159: Expected O, but got Unknown
            //IL_0167: Unknown result type (might be due to invalid IL or missing references)
            //IL_016c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0177: Expected O, but got Unknown
            //IL_0178: Expected O, but got Unknown
            //IL_018f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0194: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a0: Expected O, but got Unknown
            //IL_01ae: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
            //IL_01be: Expected O, but got Unknown
            //IL_01bf: Expected O, but got Unknown
            //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e2: Expected O, but got Unknown
            //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
            //IL_01fb: Expected O, but got Unknown
            //IL_01fc: Expected O, but got Unknown
            //IL_0206: Unknown result type (might be due to invalid IL or missing references)
            //IL_020b: Unknown result type (might be due to invalid IL or missing references)
            //IL_021c: Expected O, but got Unknown
            //IL_021d: Expected O, but got Unknown
            string sql = "INSERT INTO Organize\r\n\t\t\t\t(ID,Name,Number1,Type,Status,ParentID,Sort,Depth,ChildsLength,ChargeLeader,Leader,Note,IntID) \r\n\t\t\t\tVALUES(:ID,:Name,:Number1,:Type,:Status,:ParentID,:Sort,:Depth,:ChildsLength,:ChargeLeader,:Leader,:Note,:IntID)";

            OracleParameter[] obj = new OracleParameter[13];
            OracleParameter   val = new OracleParameter(":ID", 126, 40);

            ((DbParameter)val).Value = model.ID;
            obj[0] = val;
            OracleParameter val2 = new OracleParameter(":Name", 126, 2000);

            ((DbParameter)val2).Value = model.Name;
            obj[1] = val2;
            OracleParameter val3 = new OracleParameter(":Number1", 126, 900);

            ((DbParameter)val3).Value = model.Number;
            obj[2] = val3;
            OracleParameter val4 = new OracleParameter(":Type", 112);

            ((DbParameter)val4).Value = model.Type;
            obj[3] = val4;
            OracleParameter val5 = new OracleParameter(":Status", 112);

            ((DbParameter)val5).Value = model.Status;
            obj[4] = val5;
            OracleParameter val6 = new OracleParameter(":ParentID", 126, 40);

            ((DbParameter)val6).Value = model.ParentID;
            obj[5] = val6;
            OracleParameter val7 = new OracleParameter(":Sort", 112);

            ((DbParameter)val7).Value = model.Sort;
            obj[6] = val7;
            OracleParameter val8 = new OracleParameter(":Depth", 112);

            ((DbParameter)val8).Value = model.Depth;
            obj[7] = val8;
            OracleParameter val9 = new OracleParameter(":ChildsLength", 112);

            ((DbParameter)val9).Value = model.ChildsLength;
            obj[8] = val9;
            _003F val10;

            if (model.ChargeLeader != null)
            {
                val10 = new OracleParameter(":ChargeLeader", 126, 200);
                ((DbParameter)val10).Value = model.ChargeLeader;
            }
            else
            {
                val10 = new OracleParameter(":ChargeLeader", 126, 200);
                ((DbParameter)val10).Value = DBNull.Value;
            }
            obj[9] = val10;
            _003F val11;

            if (model.Leader != null)
            {
                val11 = new OracleParameter(":Leader", 126, 200);
                ((DbParameter)val11).Value = model.Leader;
            }
            else
            {
                val11 = new OracleParameter(":Leader", 126, 200);
                ((DbParameter)val11).Value = DBNull.Value;
            }
            obj[10] = val11;
            _003F val12;

            if (model.Note != null)
            {
                val12 = new OracleParameter(":Note", 119);
                ((DbParameter)val12).Value = model.Note;
            }
            else
            {
                val12 = new OracleParameter(":Note", 119);
                ((DbParameter)val12).Value = DBNull.Value;
            }
            obj[11] = val12;
            OracleParameter val13 = new OracleParameter(":IntID", 112);

            ((DbParameter)val13).Value = model.IntID;
            obj[12] = val13;
            OracleParameter[] parameter = (OracleParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
예제 #13
0
        public int Update(RoadFlow.Data.Model.Organize model)
        {
            string sql = "UPDATE Organize SET \r\n\t\t\t\tName=@Name,Number=@Number,Type=@Type,Status=@Status,ParentID=@ParentID,Sort=@Sort,Depth=@Depth,ChildsLength=@ChildsLength,ChargeLeader=@ChargeLeader,Leader=@Leader,Note=@Note,IntID=@IntID \r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] parameter = new SqlParameter[13]
            {
                new SqlParameter("@Name", SqlDbType.VarChar, 2000)
                {
                    Value = model.Name
                },
                new SqlParameter("@Number", SqlDbType.VarChar, 900)
                {
                    Value = model.Number
                },
                new SqlParameter("@Type", SqlDbType.Int, -1)
                {
                    Value = model.Type
                },
                new SqlParameter("@Status", SqlDbType.Int, -1)
                {
                    Value = model.Status
                },
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@Depth", SqlDbType.Int, -1)
                {
                    Value = model.Depth
                },
                new SqlParameter("@ChildsLength", SqlDbType.Int, -1)
                {
                    Value = model.ChildsLength
                },
                (model.ChargeLeader == null) ? new SqlParameter("@ChargeLeader", SqlDbType.VarChar, 200)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ChargeLeader", SqlDbType.VarChar, 200)
                {
                    Value = model.ChargeLeader
                },
                (model.Leader == null) ? new SqlParameter("@Leader", SqlDbType.VarChar, 200)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Leader", SqlDbType.VarChar, 200)
                {
                    Value = model.Leader
                },
                (model.Note == null) ? new SqlParameter("@Note", SqlDbType.NVarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Note", SqlDbType.NVarChar, -1)
                {
                    Value = model.Note
                },
                new SqlParameter("@IntID", SqlDbType.Int, -1)
                {
                    Value = model.IntID
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
예제 #14
0
        public int Add(RoadFlow.Data.Model.Organize model)
        {
            string sql = "INSERT INTO Organize\r\n\t\t\t\t(ID,Name,Number,Type,Status,ParentID,Sort,Depth,ChildsLength,ChargeLeader,Leader,Note,IntID) \r\n\t\t\t\tVALUES(@ID,@Name,@Number,@Type,@Status,@ParentID,@Sort,@Depth,@ChildsLength,@ChargeLeader,@Leader,@Note,@IntID)";

            SqlParameter[] parameter = new SqlParameter[13]
            {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@Name", SqlDbType.VarChar, 2000)
                {
                    Value = model.Name
                },
                new SqlParameter("@Number", SqlDbType.VarChar, 900)
                {
                    Value = model.Number
                },
                new SqlParameter("@Type", SqlDbType.Int, -1)
                {
                    Value = model.Type
                },
                new SqlParameter("@Status", SqlDbType.Int, -1)
                {
                    Value = model.Status
                },
                new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ParentID
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@Depth", SqlDbType.Int, -1)
                {
                    Value = model.Depth
                },
                new SqlParameter("@ChildsLength", SqlDbType.Int, -1)
                {
                    Value = model.ChildsLength
                },
                (model.ChargeLeader == null) ? new SqlParameter("@ChargeLeader", SqlDbType.VarChar, 200)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ChargeLeader", SqlDbType.VarChar, 200)
                {
                    Value = model.ChargeLeader
                },
                (model.Leader == null) ? new SqlParameter("@Leader", SqlDbType.VarChar, 200)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Leader", SqlDbType.VarChar, 200)
                {
                    Value = model.Leader
                },
                (model.Note == null) ? new SqlParameter("@Note", SqlDbType.NVarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Note", SqlDbType.NVarChar, -1)
                {
                    Value = model.Note
                },
                new SqlParameter("@IntID", SqlDbType.Int, -1)
                {
                    Value = model.IntID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
예제 #15
0
 public int Update(RoadFlow.Data.Model.Organize model)
 {
     return(dataOrganize.Update(model));
 }
예제 #16
0
 public int Add(RoadFlow.Data.Model.Organize model)
 {
     return(dataOrganize.Add(model));
 }
예제 #17
0
        public int Update(RoadFlow.Data.Model.Organize model)
        {
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_002b: Expected O, but got Unknown
            //IL_002c: Expected O, but got Unknown
            //IL_0039: Unknown result type (might be due to invalid IL or missing references)
            //IL_003e: Unknown result type (might be due to invalid IL or missing references)
            //IL_004a: Expected O, but got Unknown
            //IL_004b: Expected O, but got Unknown
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_005a: Unknown result type (might be due to invalid IL or missing references)
            //IL_006b: Expected O, but got Unknown
            //IL_006c: Expected O, but got Unknown
            //IL_0076: Unknown result type (might be due to invalid IL or missing references)
            //IL_007b: Unknown result type (might be due to invalid IL or missing references)
            //IL_008c: Expected O, but got Unknown
            //IL_008d: Expected O, but got Unknown
            //IL_009b: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b1: Expected O, but got Unknown
            //IL_00b2: Expected O, but got Unknown
            //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d2: Expected O, but got Unknown
            //IL_00d3: Expected O, but got Unknown
            //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f3: Expected O, but got Unknown
            //IL_00f4: Expected O, but got Unknown
            //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
            //IL_0103: Unknown result type (might be due to invalid IL or missing references)
            //IL_0114: Expected O, but got Unknown
            //IL_0115: Expected O, but got Unknown
            //IL_012e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0133: Unknown result type (might be due to invalid IL or missing references)
            //IL_013f: Expected O, but got Unknown
            //IL_0150: Unknown result type (might be due to invalid IL or missing references)
            //IL_0155: Unknown result type (might be due to invalid IL or missing references)
            //IL_0160: Expected O, but got Unknown
            //IL_0161: Expected O, but got Unknown
            //IL_017b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0180: Unknown result type (might be due to invalid IL or missing references)
            //IL_018c: Expected O, but got Unknown
            //IL_019d: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ad: Expected O, but got Unknown
            //IL_01ae: Expected O, but got Unknown
            //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
            //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d5: Expected O, but got Unknown
            //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e7: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f2: Expected O, but got Unknown
            //IL_01f3: Expected O, but got Unknown
            //IL_01fe: Unknown result type (might be due to invalid IL or missing references)
            //IL_0203: Unknown result type (might be due to invalid IL or missing references)
            //IL_0214: Expected O, but got Unknown
            //IL_0215: Expected O, but got Unknown
            //IL_0224: Unknown result type (might be due to invalid IL or missing references)
            //IL_0229: Unknown result type (might be due to invalid IL or missing references)
            //IL_023a: Expected O, but got Unknown
            //IL_023b: Expected O, but got Unknown
            string sql = "UPDATE organize SET \r\n\t\t\t\tName=@Name,Number=@Number,Type=@Type,Status=@Status,ParentID=@ParentID,Sort=@Sort,Depth=@Depth,ChildsLength=@ChildsLength,ChargeLeader=@ChargeLeader,Leader=@Leader,Note=@Note,IntID=@IntID \r\n\t\t\t\tWHERE ID=@ID";

            MySqlParameter[] obj = new MySqlParameter[13];
            MySqlParameter   val = new MySqlParameter("@Name", 752, -1);

            ((DbParameter)val).Value = model.Name;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@Number", 752, -1);

            ((DbParameter)val2).Value = model.Number;
            obj[1] = val2;
            MySqlParameter val3 = new MySqlParameter("@Type", 3, 11);

            ((DbParameter)val3).Value = model.Type;
            obj[2] = val3;
            MySqlParameter val4 = new MySqlParameter("@Status", 3, 11);

            ((DbParameter)val4).Value = model.Status;
            obj[3] = val4;
            MySqlParameter val5 = new MySqlParameter("@ParentID", 253, 36);

            ((DbParameter)val5).Value = model.ParentID;
            obj[4] = val5;
            MySqlParameter val6 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val6).Value = model.Sort;
            obj[5] = val6;
            MySqlParameter val7 = new MySqlParameter("@Depth", 3, 11);

            ((DbParameter)val7).Value = model.Depth;
            obj[6] = val7;
            MySqlParameter val8 = new MySqlParameter("@ChildsLength", 3, 11);

            ((DbParameter)val8).Value = model.ChildsLength;
            obj[7] = val8;
            _003F val9;

            if (model.ChargeLeader != null)
            {
                val9 = new MySqlParameter("@ChargeLeader", 253, 200);
                ((DbParameter)val9).Value = model.ChargeLeader;
            }
            else
            {
                val9 = new MySqlParameter("@ChargeLeader", 253, 200);
                ((DbParameter)val9).Value = DBNull.Value;
            }
            obj[8] = val9;
            _003F val10;

            if (model.Leader != null)
            {
                val10 = new MySqlParameter("@Leader", 253, 200);
                ((DbParameter)val10).Value = model.Leader;
            }
            else
            {
                val10 = new MySqlParameter("@Leader", 253, 200);
                ((DbParameter)val10).Value = DBNull.Value;
            }
            obj[9] = val10;
            _003F val11;

            if (model.Note != null)
            {
                val11 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val11).Value = model.Note;
            }
            else
            {
                val11 = new MySqlParameter("@Note", 751, -1);
                ((DbParameter)val11).Value = DBNull.Value;
            }
            obj[10] = val11;
            MySqlParameter val12 = new MySqlParameter("@IntID", 3, 11);

            ((DbParameter)val12).Value = model.IntID;
            obj[11] = val12;
            MySqlParameter val13 = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val13).Value = model.ID;
            obj[12] = val13;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
예제 #18
0
        public void UpdateAllUsers()
        {
            RoadFlow.Platform.Organize organize  = new RoadFlow.Platform.Organize();
            UsersRelation usersRelation          = new UsersRelation();
            List <RoadFlow.Data.Model.Users> all = new Users().GetAll();
            DataTable dataTable = new DataTable
            {
                Columns =
                {
                    {
                        "姓名",
                        "".GetType()
                    },
                    {
                        "帐号",
                        "".GetType()
                    },
                    {
                        "微信号",
                        "".GetType()
                    },
                    {
                        "手机号",
                        "".GetType()
                    },
                    {
                        "邮箱",
                        "".GetType()
                    },
                    {
                        "所在部门",
                        "".GetType()
                    },
                    {
                        "职位",
                        "".GetType()
                    }
                }
            };

            foreach (RoadFlow.Data.Model.Users item in all)
            {
                StringBuilder stringBuilder = new StringBuilder();
                foreach (RoadFlow.Data.Model.UsersRelation item2 in usersRelation.GetAllByUserID(item.ID))
                {
                    RoadFlow.Data.Model.Organize organize2 = organize.Get(item2.OrganizeID);
                    if (organize2 != null)
                    {
                        stringBuilder.Append(organize2.IntID);
                        stringBuilder.Append(",");
                    }
                }
                DataRow dataRow = dataTable.NewRow();
                dataRow["姓名"]   = replaceName(item.Name);
                dataRow["帐号"]   = item.Account;
                dataRow["微信号"]  = item.WeiXin;
                dataRow["手机号"]  = item.Mobile;
                dataRow["邮箱"]   = item.Email;
                dataRow["所在部门"] = stringBuilder.ToString().TrimEnd(',');
                dataRow["职位"]   = "";
                dataTable.Rows.Add(dataRow);
            }
            string text = Files.FilePath + "WeiXinCsv\\";

            if (!Directory.Exists(text))
            {
                Directory.CreateDirectory(text);
            }
            string text2 = text + Guid.NewGuid().ToString("N") + ".csv";

            NPOIHelper.ExportCSV(dataTable, text2);
            string text3 = new Media(Config.GetSecret("weixinagents_organize")).UploadTemp(text2, "file");

            if (!text3.IsNullOrEmpty())
            {
                string url   = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceuser?access_token=" + GetAccessToken();
                string text4 = "{\"media_id\":\"" + text3 + "\"}";
                string str   = HttpHelper.SendPost(url, text4);
                Log.Add("调用了微信同步所有人员", "返回:" + str, Log.Types.微信企业号, text4);
            }
        }
예제 #19
0
        public void UpdateAllOrganize()
        {
            RoadFlow.Platform.Organize          organize = new RoadFlow.Platform.Organize();
            List <RoadFlow.Data.Model.Organize> all      = organize.GetAll();
            DataTable dataTable = new DataTable
            {
                Columns =
                {
                    {
                        "部门名称",
                        "".GetType()
                    },
                    {
                        "部门ID",
                        1.GetType()
                    },
                    {
                        "父部门ID",
                        1.GetType()
                    },
                    {
                        "排序",
                        1.GetType()
                    }
                }
            };

            foreach (RoadFlow.Data.Model.Organize item in all)
            {
                int num = -1;
                if (item.ParentID.IsEmptyGuid())
                {
                    num = 1;
                }
                else
                {
                    RoadFlow.Data.Model.Organize organize2 = organize.Get(item.ParentID);
                    if (organize2 != null)
                    {
                        num = organize2.IntID;
                    }
                }
                if (num != -1)
                {
                    DataRow dataRow = dataTable.NewRow();
                    dataRow["部门名称"]  = replaceName(item.Name);
                    dataRow["部门ID"]  = item.IntID;
                    dataRow["父部门ID"] = num;
                    dataRow["排序"]    = item.Sort;
                    dataTable.Rows.Add(dataRow);
                }
            }
            string text = Files.FilePath + "WeiXinCsv\\";

            if (!Directory.Exists(text))
            {
                Directory.CreateDirectory(text);
            }
            string text2 = text + Guid.NewGuid().ToString("N") + ".csv";

            NPOIHelper.ExportCSV(dataTable, text2);
            string text3 = new Media(Config.GetSecret("weixinagents_organize")).UploadTemp(text2, "file");

            if (!text3.IsNullOrEmpty())
            {
                string url   = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty?access_token=" + GetAccessToken();
                string text4 = "{\"media_id\":\"" + text3 + "\"}";
                string str   = HttpHelper.SendPost(url, text4);
                Log.Add("调用了微信同步整个组织架构", "返回:" + str, Log.Types.微信企业号, text4);
            }
        }
예제 #20
0
 public void EditDeptAsync(RoadFlow.Data.Model.Organize organize)
 {
     new del_Save(EditDept).BeginInvoke(organize, null, null);
 }