public String getForm() { clsForm form = new clsForm(); clsResponse response = new clsResponse(); form = FacadeDA.getAllGenres(form, ref response); form = FacadeDA.getAllGenders(form, ref response); form = FacadeDA.getAllLocations(form, ref response); response.Data = serializer.Serialize(form); return(serializer.Serialize(response)); }
public string getForm() { clsForm form = new clsForm(); clsResponse response = new clsResponse(); form = FacadeDA.getAllGenres(form, ref response); form = FacadeDA.getAllLocations(form, ref response); response.Data = serializer.Serialize(form); System.Diagnostics.Debug.WriteLine(serializer.Serialize(response)); return(serializer.Serialize(response)); }
public clsForm getAllLocations(clsForm pclsForm, ref clsResponse pclsResponse) { try { return(FanRead.getAllLocations(pclsForm, ref pclsResponse)); } catch { pclsResponse.Code = 007; pclsResponse.Success = false; pclsResponse.Message = "Internal Error"; return(pclsForm);//cambiar por error } }
public static void Main() { System.Diagnostics.Stopwatch sw = Stopwatch.StartNew(); clsFacadeDA a = new clsFacadeDA(); clsForm b = new clsForm(); clsResponse c = new clsResponse(); Serializer j = new Serializer(); clsInfoBand p = new clsInfoBand(); Console.WriteLine(j.Serialize(a.getAllGenres(a.getAllGenders(b, ref c), ref c))); Console.WriteLine(sw.ElapsedMilliseconds); sw.Stop(); Console.ReadKey(); }
public void GetReturnsJsonString() { clsForm form = new clsForm(); form.genres = new List <string>(new string[] { "Rock", "Metal", "Pop" }); form.codGenres = new List <int>(new int[] { 1, 2, 3 }); form.genders = new List <string>(new string[] { "Masculino", "Femenino" }); form.codGenders = new List <int>(new int[] { 1, 2, 3 }); form.locations = new List <string>(new string[] { "Costa Rica", "Panama", "Estados Unidos" }); form.codLocations = new List <int>(new int[] { 1, 2, 3 }); var _mock = new Mock <FacadeBL>(); _mock.Setup(x => x.getFanForm()).Returns(JsonConvert.SerializeObject(form)); }
private static clsForm CheckNewFrm(string ttthisfrm, List <clsForm> frms, clsForm frm) { foreach (clsForm f in frms) { if (f.Form == ttthisfrm) { LogicError.Throw(eLogicError.X137); return(frm); } } //if (!clsForm.StaticForms.Contains(ttthisfrm) && ttthisfrm != "frmNewProject") { if (!clsForm.StaticForms.Contains(ttthisfrm)) { LogicError.Throw(eLogicError.X138); } frm = new clsForm(ttthisfrm); frms.Add(frm); return(frm); }
public clsForm getAllLocations(clsForm pclsForm, ref clsResponse pclsResponse) { try { SqlCommand cmd = new SqlCommand("myFan.SP_GetAllLocations", conn); cmd.CommandType = System.Data.CommandType.StoredProcedure; conn.Open(); SqlDataReader result = cmd.ExecuteReader(); List <String> values = new List <String>(); List <int> cods = new List <int>(); while (result.Read()) { values.Add(result["Country"].ToString()); cods.Add(Convert.ToInt32(result["Locationcode"])); } pclsForm.locations = values; pclsForm.codLocations = cods; pclsResponse.Code = 0; pclsResponse.Message = "Done"; pclsResponse.Success = true; } catch (SqlException ex) { pclsResponse.Code = 1; pclsResponse.Message = "Error while procesing your request."; pclsResponse.Success = false; } catch (Exception ex) { pclsResponse.Code = 2; pclsResponse.Message = "Unexpected error."; pclsResponse.Success = false; } finally { conn.Close(); } return(pclsForm); }
public clsForm getAllgenders(clsForm pclsForm, ref clsResponse pclsResponse) { try { SqlCommand cmd = new SqlCommand("myFan.SP_ObtenerSexosHabilitados", conn); cmd.CommandType = System.Data.CommandType.StoredProcedure; conn.Open(); SqlDataReader result = cmd.ExecuteReader(); List <String> values = new List <String>(); List <int> cods = new List <int>(); while (result.Read()) { values.Add(result["strDescripcion"].ToString()); cods.Add(Convert.ToInt32(result["intCodSexo"])); } pclsForm.genders = values; pclsForm.codGenders = cods; pclsResponse.Code = 0; pclsResponse.Message = "Done"; } catch (SqlException ex) { pclsResponse.Code = 1; pclsResponse.Success = false; pclsResponse.Message = "Error while procesing your request."; } catch (Exception ex) { pclsResponse.Code = 2; pclsResponse.Success = false; pclsResponse.Message = "Unexpected error."; } finally { conn.Close(); } return(pclsForm); }
static clsTT() { string[] ttfrmctl; string ttprevfrm = ""; string ttthisfrm = ""; char[] delimdot = new char[] { '.' }; List <clsForm> frms = new List <clsForm>(); List <string> lines = GetLines(Cfg.ToolTipsFilePath); clsForm frm = null; List <string> html = null; foreach (string l in lines) { string ltrim = l.Trim(); if (ltrim.StartsWith("$$")) { ttfrmctl = ltrim.Split(delimdot); if (ttfrmctl.Length != 2 || !ttfrmctl[1].StartsWith("$")) { LogicError.Throw(eLogicError.X136); } ttthisfrm = ttfrmctl[0].Substring(2); //omit '$$' if (ttthisfrm != ttprevfrm) //check if form already created { frm = CheckNewFrm(ttthisfrm, frms, frm); ttprevfrm = ttthisfrm; } frm.Ctrls.Add(ttfrmctl[1].Substring(1)); //omit '$' html = new List <string>(); frm.HTML.Add(html); } else if (ltrim.StartsWith("$")) { LogicError.Throw(eLogicError.X136); } else { if (l != "") { html.Add(l); } } } for (int i = 0; i < frms.Count; i++) { for (int j = frms[i].HTML.Count - 2; j >= 0; j--) //propagate last to first { if (frms[i].HTML[j].Count == 0) { frms[i].HTML[j] = frms[i].HTML[j + 1]; } } } foreach (clsForm f in frms) { LoadStaticToolTips(frms, f); } }
public clsForm getAllGenders(clsForm pclsForm, ref clsResponse pclsResponse) { return(FanDA.getAllGenders(pclsForm, ref pclsResponse)); }
public clsForm getAllLocations(clsForm pclsForm, ref clsResponse pclsResponse) { return(UserDA.getAllLocations(pclsForm, ref pclsResponse)); }
public clsForm getAllGenres(clsForm pclsForm, ref clsResponse pclsResponse) { return(UserDA.getAllGenres(pclsForm, ref pclsResponse)); }