Exemplo n.º 1
0
        public static List<object> GetAllBuddies()
        {
            try
            {
                List<VmuktiBuddy.VmuktiBuddyInfo> lstBuddyInfo = new List<VMukti.Business.VmuktiBuddy.VmuktiBuddyInfo>();
                List<VmuktiBuddy.BuddyStatus> lstBuddyStatus = new List<VMukti.Business.VmuktiBuddy.BuddyStatus>();

                List<object> objList = new List<object>();
                
                DataSet ds = new VMukti.DataAccess.clsBuddyStatus(null).GetAllBuddies();
                if (ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        VmuktiBuddy.VmuktiBuddyInfo BuddyInfo = new VMukti.Business.VmuktiBuddy.VmuktiBuddyInfo();
                        BuddyInfo.BuddyName = (string)dr["Buddy_Name"];
                        BuddyInfo.BuddyStatus = (string)dr["Buddy_Status"];
                        lstBuddyInfo.Add(BuddyInfo);
                    }
                }

                if (ds.Tables[1] != null)
                {
                    foreach (DataRow dr in ds.Tables[1].Rows)
                    {
                        VmuktiBuddy.BuddyStatus objBuddyStatus = new VMukti.Business.VmuktiBuddy.BuddyStatus();
                        objBuddyStatus.UserName = (string)dr["UserName"];
                        objBuddyStatus.BuddyName = (string)dr["BuddyName"];
                        objBuddyStatus.Status = (string)dr["BuddyStatus"];
                        lstBuddyStatus.Add(objBuddyStatus);
                    }
                }
                objList.Add(lstBuddyInfo);
                objList.Add(lstBuddyStatus);
                return objList;

            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetAllBuddies", "clsBuddyStatus.cs");
                return null;
            }
        }
Exemplo n.º 2
0
        public static List <object> GetAllBuddies()
        {
            try
            {
                List <VmuktiBuddy.VmuktiBuddyInfo> lstBuddyInfo   = new List <VMukti.Business.VmuktiBuddy.VmuktiBuddyInfo>();
                List <VmuktiBuddy.BuddyStatus>     lstBuddyStatus = new List <VMukti.Business.VmuktiBuddy.BuddyStatus>();

                List <object> objList = new List <object>();

                DataSet ds = new VMukti.DataAccess.clsBuddyStatus(null).GetAllBuddies();
                if (ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        VmuktiBuddy.VmuktiBuddyInfo BuddyInfo = new VMukti.Business.VmuktiBuddy.VmuktiBuddyInfo();
                        BuddyInfo.BuddyName   = (string)dr["Buddy_Name"];
                        BuddyInfo.BuddyStatus = (string)dr["Buddy_Status"];
                        lstBuddyInfo.Add(BuddyInfo);
                    }
                }

                if (ds.Tables[1] != null)
                {
                    foreach (DataRow dr in ds.Tables[1].Rows)
                    {
                        VmuktiBuddy.BuddyStatus objBuddyStatus = new VMukti.Business.VmuktiBuddy.BuddyStatus();
                        objBuddyStatus.UserName  = (string)dr["UserName"];
                        objBuddyStatus.BuddyName = (string)dr["BuddyName"];
                        objBuddyStatus.Status    = (string)dr["BuddyStatus"];
                        lstBuddyStatus.Add(objBuddyStatus);
                    }
                }
                objList.Add(lstBuddyInfo);
                objList.Add(lstBuddyStatus);
                return(objList);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetAllBuddies", "clsBuddyStatus.cs");
                return(null);
            }
        }