public void AddMethodOK() { //create an instance of the class we want to create clsMenuCollection AllMenu = new clsMenuCollection(); //create the item of test data clsMenu TestItem = new clsMenu(); //var to store the primary key Int32 PrimaryKey = 0; //set the properties TestItem.Name = "Cheesy"; TestItem.Description = "Classic cheese delite!"; TestItem.RecipeID = 1; TestItem.Price = 5.0; //set ThisMenu to test data AllMenu.ThisItem = TestItem; //add the record PrimaryKey = AllMenu.Add(); //set the primary key of the test data TestItem.MenuItemID = PrimaryKey; //find the record AllMenu.ThisItem.Find(PrimaryKey); //test to see that the two values are the same Assert.AreEqual(AllMenu.ThisItem, TestItem); }
//[TestMethod] public void UpdateMethodOK() { //create an instance of the class we want to create clsMenuCollection AllMenu = new clsMenuCollection(); //create the item of test data clsMenu TestItem = new clsMenu(); //var to store the primary key Int32 PrimaryKey = 0; //set the properties TestItem.Name = "Chees"; TestItem.Description = "Super Cheesy"; TestItem.RecipeID = 1; TestItem.Price = 5.0; //set ThisMenu to test data AllMenu.ThisItem = TestItem; //add the record PrimaryKey = AllMenu.Add(); //set the primary key of the test data TestItem.MenuItemID = PrimaryKey; //modify the data TestItem.Name = "Spicy"; TestItem.Description = "Mouth melting goodness"; TestItem.RecipeID = 5; TestItem.Price = 7.5; //set the record based on the new test data AllMenu.ThisItem = TestItem; //update the record AllMenu.Update(); //find the record AllMenu.ThisItem.Find(PrimaryKey); //test to see this menu matches Assert.AreEqual(AllMenu.ThisItem, TestItem); }
public void DeleteMethodOK() { //create an instance of the class we want to create clsMenuCollection AllMenu = new clsMenuCollection(); //create the item of test data clsMenu TestItem = new clsMenu(); //var to store the primary key Int32 PrimaryKey = 0; //set the properties TestItem.MenuItemID = 0; TestItem.Name = "Cheesy"; TestItem.Description = "Classic cheese delite!"; TestItem.RecipeID = 1; TestItem.Price = 5.0; //set ThisMenu to test data AllMenu.ThisItem = TestItem; //add the record PrimaryKey = AllMenu.Add(); //set the primary key of the test data TestItem.MenuItemID = PrimaryKey; //find the record AllMenu.ThisItem.Find(PrimaryKey); //delete the record AllMenu.Delete(); //now find the record Boolean Found = AllMenu.ThisItem.Find(PrimaryKey); //test to see that the record was not found Assert.IsFalse(Found); }
public DataSet getMenusGeneric(clsMenu objMenu) { dataAccess = new DataAccess(); Object[] parameters = new Object[1] { objMenu.ParentMenuCode }; return(dataAccess.LoadDataSet(parameters, "P_TM_GetMenus_Generic", "MenuList")); }
public void InstanceOK() { //create an instance of the class we want to create clsMenu AMenu = new clsMenu(); //test to see that it exists Assert.IsNotNull(AMenu); }
public DataSet getMenusUserBases(clsMenu objMenu) { dataAccess = new DataAccess(); Object[] parameters = new Object[2] { objMenu.ParentMenuCode, objMenu.LoginUserId }; return(dataAccess.LoadDataSet(parameters, "P_TM_GetMenus_UserAccess", "MenuList")); }
public DataSet getMenus(clsMenu objMenu) { dataAccess = new DataAccess(); Object[] parameters = new Object[1] { objMenu.ParentMenuCode }; //Object[] parameters = new Object[3] { objSOB.SOBId, objSOB.SOBName, objSOB.Status }; return(dataAccess.LoadDataSet(parameters, "P_TM_GetMenus", "MenuList")); }
static void Main(string[] args) { Program pro = new Program(); //procesos que inicia el programa pro.Login(); pro.Proceso(); clsMenu menu = new clsMenu(); menu.desplegar(); }
public void ValidMethodOK() { //crerate an instance of the class we want to create clsMenu AMenu = new clsMenu(); //string for error String Error = ""; //invoke method Error = AMenu.Valid(Name, Description, RecipeID, Price); //test results Assert.AreEqual(Error, ""); }
public void PricePropertyOK() { //create an instance of the class we want to create clsMenu AMenu = new clsMenu(); //create some test data to assign to the property Double TestData = 2.5; //assign the data to the property AMenu.Price = TestData; //test to see that the two values are the same Assert.AreEqual(AMenu.Price, TestData); }
public void DescriptionPropertyOK() { //create an instance of the class we want to create clsMenu AMenu = new clsMenu(); //create some test data to assign to the property String TestData = "SUPER CHEESY all natural cheese!"; //assign the data to the property AMenu.Description = TestData; //test to see that the two values are the same Assert.AreEqual(AMenu.Description, TestData); }
public void RecipeIDPropertyOK() { //create an instance of the class we want to create clsMenu AMenu = new clsMenu(); //create some test data to assign to the property Int32 TestData = 1; //assign the data to the property AMenu.RecipeID = TestData; //test to see that the two values are the same Assert.AreEqual(AMenu.RecipeID, TestData); }
public void NamePropertyOK() { //create an instance of the class we want to create clsMenu AMenu = new clsMenu(); //create some test data to assign to the property String TestData = "Cheese"; //assign the data to the property AMenu.Name = TestData; //test to see that the two values are the same Assert.AreEqual(AMenu.Name, TestData); }
public void FindMethodOK() { //crerate an instance of the class we want to create clsMenu AMenu = new clsMenu(); //boolean variable to store the result of the validation Boolean Found = false; //create some test data to use with the method Int32 MenuID = 1; //invoke the method Found = AMenu.Find(MenuID); //test to see that the result is correct Assert.IsTrue(Found); }
public void PriceMinLessOne() { //crerate an instance of the class we want to create clsMenu AMenu = new clsMenu(); //string for error String Error = ""; //test data Double Price = -1; //invoke method Error = AMenu.Valid(Name, Description, RecipeID, Price); //test results Assert.AreNotEqual(Error, ""); }
public void DescriptionMaxPlusOne() { //crerate an instance of the class we want to create clsMenu AMenu = new clsMenu(); //string for error String Error = ""; //test data string Description = "01234567890123456789012345678901234567890"; //invoke method Error = AMenu.Valid(Name, Description, RecipeID, Price); //test results Assert.AreNotEqual(Error, ""); }
public void ThisMenuItemPropertyOK() { //create an instance of the class we want to create clsMenuCollection AllMenu = new clsMenuCollection(); //create the item of test data clsMenu TestMenu = new clsMenu(); //set its properties TestMenu.MenuItemID = 1; TestMenu.Name = "Classic Cheese"; TestMenu.Description = "SUPER CHEESY GOOD!"; TestMenu.RecipeID = 3; TestMenu.Price = 9.9; //assign the data to the property AllMenu.ThisMenuItem = TestMenu; //test they're the same Assert.AreEqual(AllMenu.ThisMenuItem, TestMenu); }
protected void Page_Load(object sender, EventArgs e) { //create a new instance of clsMenu clsMenu AMenu = new clsMenu(); //get the data from the session object AMenu = (clsMenu)Session["AMenu"]; //display the house number for this entry Response.Write(AMenu.MenuItemID); //display the name for this entry Response.Write(AMenu.Name); //display the description for this entry Response.Write(AMenu.Description); //display the recipe for this entry Response.Write(AMenu.RecipeID); //display the price for this entry Response.Write(AMenu.Price); }
public List <clsMenu> ConsultaMenuPadre() { try { List <clsMenu> Lst = new List <clsMenu>(); TECAv8Entities oEnti = new TECAv8Entities(); var Query = from q in oEnti.Menu where q.IdPadre == null select q; foreach (var item in Query) { clsMenu Obj = new clsMenu(); Obj.IdMenu = item.IdMenu; Obj.IdPadre = Convert.ToInt32(item.IdPadre); Obj.Descripcion = item.Descripcion; Obj.NombreFormulario = item.NombreFormulario; Obj.NombreAssembly = item.NombreAssembly; Lst.Add(Obj); } return(Lst); } catch (Exception e) { return(null); } }
public List<clsMenu> ConsultaMenuPadre() { try { List<clsMenu> Lst = new List<clsMenu>(); TECAv8Entities oEnti = new TECAv8Entities(); var Query = from q in oEnti.Menu where q.IdPadre == null select q; foreach (var item in Query) { clsMenu Obj = new clsMenu(); Obj.IdMenu = item.IdMenu; Obj.IdPadre = Convert.ToInt32(item.IdPadre); Obj.Descripcion = item.Descripcion; Obj.NombreFormulario = item.NombreFormulario; Obj.NombreAssembly = item.NombreAssembly; Lst.Add(Obj); } return Lst; } catch (Exception e) { return null; } }
private void loadMenu() { // soon add image here foreach (ApplicationMenu menu in Enum.GetValues(typeof(ApplicationMenu))) { clsMenu menuClass = new clsMenu(); switch (menu.ToString()) { case "Inventory": menuClass.Title = menu.ToString(); menuClass.Icon = ilMain.Images[ilMain.Images.IndexOfKey("inventory")]; break; case "Sales": menuClass.Title = menu.ToString(); menuClass.Icon = ilMain.Images[ilMain.Images.IndexOfKey("sales")]; break; case "Settings": menuClass.Title = menu.ToString(); menuClass.Icon = ilMain.Images[ilMain.Images.IndexOfKey("settings")]; break; default: break; } if (String.IsNullOrEmpty(menuClass.Title)) { return; } listClsMenu.Add(menuClass); } }
public void ListAndCountOK() { //create an instance of the class we want to create clsMenuCollection AllMenu = new clsMenuCollection(); //create some test data to assign to the property //in this case the data needs to be a list of objects List <clsMenu> TestList = new List <clsMenu>(); //add an item to the list //create the item of test data clsMenu TestItem = new clsMenu(); //set its properties TestItem.MenuItemID = 1; TestItem.Name = "Classic Cheese"; TestItem.Description = "SUPER CHEESY GOOD!"; TestItem.RecipeID = 3; TestItem.Price = 9.9; //add the item to the test list TestList.Add(TestItem); //assign the data to the property AllMenu.MenuList = TestList; //test to see that the two values are the same Assert.AreEqual(AllMenu.Count, TestList.Count); }
protected override void OnCreate(Bundle bundle) { try { base.OnCreate(bundle); SetContentView(Resource.Layout.Menu); mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar1); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); mLeftDrawer = FindViewById <ListView>(Resource.Id.left_drawer); SetSupportActionBar(mToolBar); mDrawerToggle = new MyActionBarDrawerToogle( this, mDrawerLayout, Resource.String.openDrawer, Resource.String.closeDrawer ); mDrawerLayout.SetDrawerListener(mDrawerToggle); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); mDrawerToggle.SyncState(); SupportActionBar.SetTitle(mBienvenidoResource); mListIems = new List <clsMenu>(); clsMenu objMenuMovimientos = new clsMenu("Consulta de Movimientos", Resource.Drawable.ic_consulta_movimiento); clsMenu objMenuTransferencias = new clsMenu("Transferencias", Resource.Drawable.ic_transferencia); clsMenu objMenuPagoServicios = new clsMenu("Pago Servicios", Resource.Drawable.ic_pago_servicios); clsMenu objMenuPagoTarjeras = new clsMenu("Pago Tarjetas", Resource.Drawable.ic_pago_tarjetas); clsMenu objMenuAgregarCuenta = new clsMenu("Agregar Cuenta", Resource.Drawable.ic_agregar_cuenta); clsMenu objMenuSalir = new clsMenu("Salir", Resource.Drawable.ic_salir); mListIems.Add(objMenuMovimientos); mListIems.Add(objMenuTransferencias); mListIems.Add(objMenuPagoServicios); mListIems.Add(objMenuPagoTarjeras); mListIems.Add(objMenuAgregarCuenta); mListIems.Add(objMenuSalir); imageUrl = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario); strIdentificacion = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario); strCuentaJson = Intent.GetStringExtra(clsConstantes.strCuentaJson); strIdUsuario = Intent.GetStringExtra(clsConstantes.strIdUsuario); strCooperativa = Intent.GetStringExtra(clsConstantes.strCooperativas); lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa); string[] arrRespuesta = strCuentaJson.Split('|'); string strCuentas = arrRespuesta[0]; string strTarjetas = arrRespuesta[1]; cuentasItems = JsonConvert.DeserializeObject <List <clsCuenta> >(strCuentas); tarjetasItems = JsonConvert.DeserializeObject <List <clsTarjetaCedito> >(strTarjetas); mArrayAdapter = new menu_adapter(this, mListIems); mLeftDrawer.Adapter = mArrayAdapter; mLeftDrawer.ItemClick += mLeftDrawer_ItemClick; //Llenar cuentas if (cuentasItems.Count > 0) { listViewCuentas = FindViewById <ListView>(Resource.Id.ListCuenta); listViewCuentas.Adapter = new cuentas_adapter(this, cuentasItems, lstCooperativas); listViewCuentas.ItemClick += OnListItemClickCuentas; // to be defined } //Llenar tarjetas if (tarjetasItems.Count > 0) { listViewTarjetas = FindViewById <ListView>(Resource.Id.ListTarjeta); listViewTarjetas.Adapter = new tarjetas_adapter(this, tarjetasItems); listViewTarjetas.ItemClick += OnListItemClickTarjetas; // to be defined } } catch (Exception ex) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle("Alerta"); alert.SetMessage("Ocurió un problema con al abrir la pantalla"); RunOnUiThread(() => { alert.Show(); }); } }