public IHttpActionResult PutJDADebugInfo(int id, JDADebugInfo jDADebugInfo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != jDADebugInfo.ID)
            {
                return(BadRequest());
            }

            db.Entry(jDADebugInfo).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!JDADebugInfoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            JDADebugInfo jDADebugInfo = db.JDADebugInfoes.Find(id);

            db.JDADebugInfoes.Remove(jDADebugInfo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ID,BugName,ClientName,CreatedBy,AnalyticsInfo,CurrentDate")] JDADebugInfo jDADebugInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(jDADebugInfo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(jDADebugInfo));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "ID,BugName,ClientName,CreatedBy,AnalyticsInfo,CurrentDate")] JDADebugInfo jDADebugInfo)
        {
            if (ModelState.IsValid)
            {
                db.JDADebugInfoes.Add(jDADebugInfo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(jDADebugInfo));
        }
        public IHttpActionResult GetJDADebugInfo(int id)
        {
            JDADebugInfo jDADebugInfo = db.JDADebugInfoes.Find(id);

            if (jDADebugInfo == null)
            {
                return(NotFound());
            }

            return(Ok(jDADebugInfo));
        }
        public IHttpActionResult PostJDADebugInfo(JDADebugInfo jDADebugInfo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            jDADebugInfo.CurrentDate = DateTime.Now;

            db.JDADebugInfoes.Add(jDADebugInfo);
            db.SaveChanges();
            MessageCallback(jDADebugInfo);
            return(CreatedAtRoute("DefaultApi", new { id = jDADebugInfo.ID }, jDADebugInfo));
        }
Ejemplo n.º 7
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            JDADebugInfo jDADebugInfo = db.JDADebugInfoes.Find(id);

            if (jDADebugInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(jDADebugInfo));
        }
        public IHttpActionResult DeleteJDADebugInfo(int id)
        {
            JDADebugInfo jDADebugInfo = db.JDADebugInfoes.Find(id);

            if (jDADebugInfo == null)
            {
                return(NotFound());
            }

            db.JDADebugInfoes.Remove(jDADebugInfo);
            db.SaveChanges();

            return(Ok(jDADebugInfo));
        }
Ejemplo n.º 9
0
        // GET: JDADebugInfoesMvc/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            JDADebugInfo jDADebugInfo = db.JDADebugInfoes.Find(id);

            if (jDADebugInfo == null)
            {
                return(HttpNotFound());
            }
            return(Redirect("~/JdaBugViiew/Index?bugId=" + id));
            // return View(jDADebugInfo);
        }
        private static async void MessageCallback(JDADebugInfo jDADebugInfo)
        {
            foreach (var subscriber in _streammessage1)
            {
                try
                {
                    await subscriber.WriteLineAsync("data:" + Newtonsoft.Json.JsonConvert.SerializeObject(jDADebugInfo) + "\n");

                    await subscriber.FlushAsync();

                    subscriber.Dispose();
                }


                catch (Exception)
                {
                    StreamWriter ignore;
                    // subscriber.(out ignore);
                }
                //   subscriber.Close();
            }
        }
Ejemplo n.º 11
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            try
            {
                string         connetionString = null;
                SqlConnection  connection;
                SqlCommand     command;
                SqlDataAdapter adpter = new SqlDataAdapter();
                DataSet        ds     = new DataSet();
                //XmlReader xmlFile ;
                string sql = null;
                connetionString = "Password = myoxynova@987; Persist Security Info = True; User ID = myoxynova; Initial Catalog = oxynovaDB; Data Source = 118.67.248.175";
                connection      = new SqlConnection(connetionString);
                SqlCommand cmd = new SqlCommand("select * from JDADebugActivityInfoes where 1!=1", connection);
                //SqlDataAdapter adp = new SqlDataAdapter(cmd);
                //adp.Fill(ds);
                //  string dbDatabasePath = "G:\\Instances\\";

                string        path   = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/jDADebugActivityInfo.xml");
                XmlTextReader reader = new XmlTextReader(path);
                ds.ReadXml(reader);


                string study_site            = "";
                string traditional_authority = "";
                string community             = "";



                int i = 0;

                connection.Open();
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    cmd.CommandText = " INSERT INTO [dbo].[JDADebugActivityInfoes]  ([ScreenShot],[ActivityData] ,[NetworkData],[DeviceOrientation] ,[BugId] ,CPUUses ,MemoryUses ,[VirtualMemory])    VALUES  ('" + dr[0] + "' ,'" + dr[1] + "','" + dr[2] + "','" + dr[3] + "','" + dr[5] + "','" + dr[7] + "','" + dr[8] + "','" + dr[9] + "')";
                    int iii = cmd.ExecuteNonQuery();
                }
                //using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection))
                //{
                //  connection.Open();
                //  bulkCopy.DestinationTableName = "[dbo].[JDADebugActivityInfoes]";
                //  try
                //  {
                //    bulkCopy.WriteToServer(ds.Tables[0]);
                //  }
                //  catch (Exception e)
                //  {
                //    Console.Write(e.Message);
                //  }
                // }
                connection.Close();
                //   MessageBox.Show("Record Inserted Successfully !!!", "Saving Record", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                //  MessageBox.Show(ex.Message);
            }
            JDADebugInfo jDADebugInfo = db.JDADebugInfoes.Find(id);

            if (jDADebugInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(jDADebugInfo));
        }