public ActionResult GetDurum() { string strcon = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString; string FirmaID = Session["FirmaID"].ToString(); List <TECHNICAL> yonetim = new List <TECHNICAL>(); string sorg = @"select COUNT(ID) as oALan10,Durum from TECHNICAL Where FirmaID =" + FirmaID + " group by Durum"; using (SqlConnection con = new SqlConnection(strcon)) { con.Open(); using (SqlCommand servisgetir = new SqlCommand(sorg, con)) { using (SqlDataReader dr = servisgetir.ExecuteReader()) { while (dr.Read()) { TECHNICAL yt = new TECHNICAL(); yt.Durum = dr["Durum"].ToString(); yt.oAlan10 = dr["oAlan10"].ToString(); //yt.Tarih = dr["Tarih"].ToString(); yonetim.Add(yt); } } } } return(Json(new { data = yonetim.Distinct() }, JsonRequestBehavior.AllowGet)); }
public ActionResult YeniTahsilat(int id = 0) { ViewBag.vKasaID = Session["vKasaID"].ToString(); ViewBag.vBankaID = Session["vBankaID"].ToString(); AyarMetot.Siradaki("", "TAHSILAT", "IslemNo", Session["FirmaID"].ToString()); ViewBag.MasrafSiradakiNo = AyarMetot.GetNumara; if (Session["Grubu"].ToString() != "Teknik Servis Kullanıcısı") { if (id != 0) { CASH_PAY cp = db.CASH_PAY.Where(x => x.ID == id).FirstOrDefault <CASH_PAY>(); if (cp.IslemTipi != "KAF" && cp.IslemTipi != "BAF") { return(View(cp)); } else { return(RedirectToAction("FinansHareketleri", "Finans")); } } else { return(View(new CASH_PAY())); } } else { try { TECHNICAL tech = db.TECHNICAL.Where(x => x.ID == id).FirstOrDefault <TECHNICAL>(); ViewBag.ServisCariID = tech.CariID; } catch { } try { ViewBag.ServisPersonelID = Session["PersonelID"].ToString(); int idpersonel = Convert.ToInt32(Session["PersonelID"].ToString()); Personel pr = db.Personel.Where(x => x.ID == idpersonel).FirstOrDefault <Personel>(); ViewBag.PersonelKasaId = pr.vKasaID; ViewBag.PersonelBankaId = pr.vBankaID; } catch { } return(View(new CASH_PAY())); } }