public JsonResult GetNewMessages(string j, int?_START_LIMIT, int?_END_LIMIT) { dynamic x = JsonConvert.DeserializeObject(j); string conStr = Session["conStr"].ToString(); //ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString; int uid = Convert.ToInt32(Session["CURENT_USER_ID"]); if (x.id_dosar != null) { DosareRepository dr = new DosareRepository(uid, conStr); Dosar d = (Dosar)dr.Find(Convert.ToInt32(x.id_dosar)).Result; //return Json(d.GetNewMesaje(Convert.ToDateTime(x.last_refresh)), JsonRequestBehavior.AllowGet); return(Json(d.GetNewMesaje(DateTime.ParseExact(Convert.ToString(x.last_refresh), CommonFunctions.DATE_TIME_FORMAT, System.Globalization.CultureInfo.InvariantCulture)), JsonRequestBehavior.AllowGet)); } else { Utilizator u = (Utilizator)Session["CURENT_USER"]; return(Json(u.GetNewMesaje(DateTime.ParseExact(Convert.ToString(x.last_refresh), CommonFunctions.DATE_TIME_FORMAT, System.Globalization.CultureInfo.InvariantCulture), _START_LIMIT, _END_LIMIT), JsonRequestBehavior.AllowGet)); } }
public DocumentView(int _CURENT_USER_ID, int _ID_DOSAR, string conStr) { this.ID_DOSAR = _ID_DOSAR; TipDocumenteRepository tdr = new TipDocumenteRepository(_CURENT_USER_ID, conStr); //this.TipuriDocumente = (TipDocument[])tdr.GetAll().Result; TipDocument[] tipuriDocumente = (TipDocument[])tdr.GetAll().Result; DosareRepository dr = new DosareRepository(_CURENT_USER_ID, conStr); Dosar d = (Dosar)dr.Find(_ID_DOSAR).Result; //this.DocumenteScanate = (DocumentScanat[])d.GetDocumente().Result; DocumentScanat[] dss = (DocumentScanat[])d.GetDocumente().Result; /* * List<TipDocumentJson> l = new List<TipDocumentJson>(); * foreach (TipDocument td in tipuriDocumente) * { * List<DocumentScanat> ld = new List<DocumentScanat>(); * foreach(DocumentScanat ds in dss) * { * if(ds.ID_TIP_DOCUMENT == td.ID) * { * ld.Add(ds); * } * } * l.Add(new TipDocumentJson(td, ld.ToArray())); * } * this.TipuriDocumente = l.ToArray(); * //this.CurDocumentScanat = new DocumentScanat(); */ this.TipuriDocumente = new TipDocumentJson[tipuriDocumente.Length]; for (int i = 0; i < tipuriDocumente.Length; i++) { List <DocumentScanat> ld = new List <DocumentScanat>(); for (int j = 0; j < dss.Length; j++) { if (dss[j].ID_TIP_DOCUMENT == tipuriDocumente[i].ID) { ld.Add(dss[j]); } } this.TipuriDocumente[i] = new TipDocumentJson(tipuriDocumente[i], ld.ToArray()); } ResourceSet resourceSet = socisaV2.Resources.TipDocumenteResx.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true); List <KeyValuePair <string, string> > t = new List <KeyValuePair <string, string> >(); foreach (DictionaryEntry entry in resourceSet) { t.Add(new KeyValuePair <string, string>(entry.Key.ToString(), entry.Value.ToString())); } this.TranslatedTipDocumenteNames = new string[t.Count][]; for (int i = 0; i < t.Count; i++) { this.TranslatedTipDocumenteNames[i] = new string[2]; this.TranslatedTipDocumenteNames[i][0] = t[i].Key; this.TranslatedTipDocumenteNames[i][1] = t[i].Value; } }