Beispiel #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Chamado.Models.Chamado chamadomodel = await db.Chamados.FindAsync(id);

            db.Chamados.Remove(chamadomodel);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public async Task <ActionResult> Edit([Bind(Include = "IdChamado,Descricao")] Chamado.Models.Chamado chamadomodel)
        {
            if (ModelState.IsValid)
            {
                db.Entry(chamadomodel).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(chamadomodel));
        }
Beispiel #3
0
        // GET: /Chamado/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Chamado.Models.Chamado chamadomodel = await db.Chamados.FindAsync(id);

            if (chamadomodel == null)
            {
                return(HttpNotFound());
            }
            return(View(chamadomodel));
        }
Beispiel #4
0
        //[ValidateAntiForgeryToken]
        //[Bind(Include = "Motivo,Descricao,Sistema,SituacaoProj")]
        public ActionResult GravaChamado(Chamado.Models.Chamado chamado)
        {
            var files = Request.Files;

            //var imageTypes = new string[]{
            //        "image/gif",
            //        "image/jpeg",
            //        "image/pjpeg",
            //        "image/png"
            //    };


            //var numero = rndNumero.Next().ToString();
            var date = DateTime.Now.Ticks;

            DateTime myDate = new DateTime(date);
            String   test   = myDate.ToString("MMMM dd, yyyy");



            //### -
            //var imagemNome = String.Format("{0:yyyyMMdd-HHmmssfff}", DateTime.Now);
            //var extensao = System.IO.Path.GetExtension(chamadomodel.Anexo.Extensao).ToLower();
            //using (var img = System.Drawing.Image.FromStream()
            //{
            //    chamadomodel.Anexo.ConteudoAnexo = String.Format("/ProdutoImagens/{0}{1}", imagemNome, extensao);
            //    // Salva imagem
            //    SalvarNaPasta(img, chamadomodel.Anexo.ConteudoAnexo);
            //}

            //chamadomodel.Usuario = "Externo";
            //chamadomodel.NumChamado = "brati" + date;

            //if (ModelState.IsValid)
            //{
            //    db.Chamados.Add(chamadomodel);
            //    db.SaveChanges();
            //    return RedirectToAction("SucessoCadastro", chamadomodel);
            //}


            return(Json(chamado));

            //return PartialView("SucessoCadastro", chamadomodel);
            //return RedirectToRoute("SucessoCadastro", new RouteValueDictionary(chamadomodel));
            //return RedirectToAction("SucessoCadastro", "Chamado", new { chamadoModel = obj });
        }
Beispiel #5
0
 // GET: /Chamado/Edit/5
 public ActionResult Editar(Chamado.Models.Chamado chamadomodel)
 {
     return(View(chamadomodel));
 }
Beispiel #6
0
 public ActionResult SucessoCadastro(Chamado.Models.Chamado chamadoModel)
 {
     return(View(chamadoModel));
 }