public ActionResult gorevtamamla(TBLDOKUMAN model, HttpPostedFileBase file) { if (file != null) { byte[] belge = new byte[file.ContentLength]; file.InputStream.Read(belge, 0, file.ContentLength); string path = System.IO.Path.GetFileName(file.FileName); model.BELGE = belge; model.DOSYA_YOLU = path; model.REC_DATE = DateTime.Now; model.REC_UPDATE = DateTime.Now; model.REC_UPUSERNAME = (string)Session["UserName"]; model.REC_UPUSERNO = (int)Session["UserId"]; model.REC_USERNAME = (string)Session["UserName"]; model.REC_USERNO = (int)Session["UserId"]; model.REC_CHANGED = "0"; model.REC_VERSION = CreateCommon.REC_VERSION; entities.TBLDOKUMAN.Add(model); entities.SaveChanges(); TBLGOREV gorevmodel = new TBLGOREV(); gorevmodel = entities.TBLGOREV.Where(m => m.GOREV_KOD.Equals(model.GOREV_KOD)).FirstOrDefault(); gorevmodel.DURUM = 3; entities.Entry(gorevmodel).State = EntityState.Modified; entities.SaveChanges(); } return(RedirectToAction("GörevGörüntüle")); }
public ActionResult gorevonay(string id) { TBLGOREV model = new TBLGOREV(); model = entities.TBLGOREV.Find(id); return(View(model)); }
public JsonResult gorevkodTest() { var routeValue = RouteData.Values["id"]; //SqlConnection conn = new SqlConnection("Data Source=ESRA\\SQLEXPRESS; Initial Catalog=isTakip;integrated security=True;MultipleActiveResultSets=True;"); //conn.Open(); //SqlCommand command = new SqlCommand("select '" + routeValue + "'", conn); //DataTable dataTable = new DataTable(); //SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(command); //sqlDataAdapter.Fill(dataTable); //sqlDataAdapter.Dispose(); Boolean result = false; TBLGOREV id = entities.TBLGOREV.SingleOrDefault(x => x.GOREV_KOD.Equals(routeValue.ToString())); if (id != null) { result = true; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult gorevonay(TBLGOREV model) { model.REC_VERSION = CreateCommon.REC_VERSION; model.REC_UPUSERNO = (int)Session["UserId"]; model.REC_UPUSERNAME = (string)Session["UserName"]; model.REC_UPDATE = DateTime.Now; model.REC_CHANGED = "1"; model.DURUM = 2; entities.Entry(model).State = EntityState.Modified; entities.SaveChanges(); return(RedirectToAction("GörevGörüntüle")); }
public ActionResult gorevtamamla(string id) { TBLDOKUMAN model = new TBLDOKUMAN(); TBLGOREV gorevmodel = new TBLGOREV(); gorevmodel = entities.TBLGOREV.Find(id); model.PROJE_KOD = gorevmodel.PROJE_KOD; model.GOREV_KOD = id; return(View(model)); }
public ActionResult gorevAta(TBLGOREV model) { if (model.GOREV_KOD != "" & model.PERSONEL_KOD != "" & model.PROJE_KOD != "" & model.GOREV_TANIMI != "") { model.REC_DATE = DateTime.Now; model.REC_UPDATE = DateTime.Now; model.REC_UPUSERNAME = (String)Session["UserName"]; model.REC_UPUSERNO = (int)Session["UserId"]; model.REC_USERNAME = (String)Session["UserName"]; model.REC_USERNO = (int)Session["UserId"]; model.REC_CHANGED = "0"; model.REC_VERSION = CreateCommon.REC_VERSION; model.DURUM = 1; entities.TBLGOREV.Add(model); entities.SaveChanges(); return(RedirectToAction("gorevAta", "ProjePersonel")); } else { return(View()); } }