protected DataTable GetLocationCoordinates()
        {
            _reference = new AndroidSecurityWS();
            DataTable dt = new DataTable();

            dt = _reference.GetLocation(Session[_Default.session_device_id].ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                DataTable dtNew = dt.Clone();
                decimal   count = Convert.ToDecimal(dt.Rows.Count.ToString());
                if (count > 5)
                {
                    count = 5;
                }

                for (int i = 0; i < count; i++)
                {
                    dtNew.ImportRow(dt.Rows[i]);
                }

                return(dtNew);
            }
            else
            {
                return(dt);
            }
        }
Beispiel #2
0
        public void ProcessRequest(HttpContext context)
        {
            string            regKey = "APA91bHAs4_4tQbLOvCuoLANN5NVrJvVbauKkeBfBrr3ehesvmSrlmCfud3fcI5HE1KviOC18qa3lvDK9Xb7gKvlGbPi7vwUCFoLIg3In7Wd1O3S_nzTJk3Tf9fZC7eV-E3K2Yny8GPBmxh8B_lkPuJUbOYaM64KKg";
            AndroidSecurityWS wef    = new AndroidSecurityWS();

            byte[] bytes = wef.getImageByteArray(regKey);
            context.Response.ContentType = "image/jpeg";
            context.Response.OutputStream.Write(bytes, 0, bytes.Length);
        }
        protected string GetRegKey(string device_id)
        {
            _reference = new AndroidSecurityWS();
            string registration_key = string.Empty;

            registration_key = _reference.GetRegistrationKey(device_id);

            return(registration_key);
        }
        protected bool isUserValid(string username, string password)
        {
            _reference = new AndroidSecurityWS();
            bool isValid = false;

            isValid = _reference.checkUser(username, password);

            return(isValid);
        }
 protected void SendPhoto(object sender, EventArgs e)
 {
     locationHistoryPanel.Visible = false;
     imagePanel.Visible           = false;
     _reference = new AndroidSecurityWS();
     _reference.deleteImage(Session[_Default.session_device_id].ToString());
     SendCommandToPhone(Take_Picture);
     mapPanel.Visible = false;
     GenerateImageControl();
 }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            _reference = new AndroidSecurityWS();
            user_id    = txtEmailId.Text.ToUpper();
            DataTable dt = new DataTable();

            dt = _reference.getUserLoginInfo(user_id);
            string dt_user_id  = string.Empty;
            string dt_answer   = string.Empty;
            string dt_email    = string.Empty;
            bool   isDelivered = false;

            if (dt != null && dt.Rows.Count > 0)
            {
                dt_user_id = dt.Rows[0][USER_ID].ToString();
                dt_answer  = dt.Rows[0][ANSWER].ToString();
                if (txtAnswer.Visible == false && txtQuestion.Visible == false)
                {
                    question              = dt.Rows[0][QUESTION].ToString().ToUpper();
                    txtQuestion.Text      = question;
                    txtEmailId.Enabled    = false;
                    txtEmailId.Font.Bold  = true;
                    QuestionPanel.Visible = true;
                }

                else
                {
                    answer = txtAnswer.Text.ToUpper();
                    if (user_id == dt_user_id && answer == dt_answer)
                    {
                        string password = dt.Rows[0][PASSWORD].ToString();
                        string body     = "Hello! Your User-Id is" + " " + user_id + " and Password is " + password;
                        isDelivered = _reference.sendMail(string.Empty, string.Empty, dt_user_id, SUBJECT, body, false);
                    }
                    HidePanels();
                    if (isDelivered == true)
                    {
                        string text = MAIL_SUCCESSFUL;
                        ShowMsg(text);
                    }
                    else
                    {
                        string text = MAIL_FAIL;
                        ShowError(text);
                    }
                }
            }

            else
            {
                HidePanels();
                string text = EMAIL_ERROR;
                ShowError(text);
            }
        }
Beispiel #7
0
        //string session_reg_key = string.Empty;
        public void ProcessRequest(HttpContext context)
        {
            AndroidWebApp.WebReference.AndroidSecurityWS _reference = new AndroidSecurityWS();
            byte[] byteArray1 = null;
            byteArray1 = getImage();
            context.Response.ContentType = "image/jpeg";
            if (byteArray1 != null)
            {
                context.Response.OutputStream.Write(byteArray1, 0, byteArray1.Length);
            }

            else
            {
            }
        }
        protected DataTable GetDeviceInfo()
        {
            _reference = new AndroidSecurityWS();
            DataTable dt = new DataTable();

            if (Session[_Default.session_device_id] != null)
            {
                dt = _reference.getUserInformation(Session[_Default.session_device_id].ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    return(dt);
                }
                else
                {
                    return(dt);
                }
            }
            else
            {
                return(dt);
            }
        }