Пример #1
0
        private DataGridView _GetMessages(string Location, int Index, int Count, DataGridView DataGrid)
        {
            try
            {
                if (!network.CheckConection())
                {
                    FMessegeBox.FarsiMessegeBox.Show("مشکل در اتصال به اینترنت"); return(null);
                }
                servisesms.Send sms         = new servisesms.Send();
                int             locationInt = 0;
                if (Location == "دریافتی")
                {
                    locationInt = 1;
                }
                else if (Location == "ارسالی")
                {
                    locationInt = 2;
                }
                else
                {
                    locationInt = 3;
                }

                DataGrid.Rows.Clear();
                servisesms.MessagesBL[] messages = sms.GetMessages(txtUserName.Text, txtPass.Text, locationInt, txtShomare.Text, Index, Count);
                foreach (servisesms.MessagesBL message in messages)
                {
                    DataGrid.Rows.Add("", message.Sender, message.Body, PersianDate.GetPersianDate(message.SendDate));
                }
                return(DataGrid);
            }
            catch (Exception ex)
            {
                FMessegeBox.FarsiMessegeBox.Show(ex.Message, "خطا");
                return(null);
            }
        }