static void Main(string[] args) { CRoot CompositionRoot = new CRoot("prod"); //IUsersDAL users_dal = CompositionRoot.UsersDAL; //IMoviesDAL movies_dal = CompositionRoot.MoviesDAL; IUsersBLL users_bll = CompositionRoot.UsersBLL; IMoviesBLL movies_bll = CompositionRoot.MoviesBLL; }
static void Main(string[] args) { try { usersBLL = Provaider.UsersBLL; imagesBLL = Provaider.ImagesBLL; relationsBLL = Provaider.RelationsBLL; bool succes; int menuNumber = 0; do { do { System.Console.Clear(); System.Console.WriteLine(" 1 - Show all users"); System.Console.WriteLine(" 2 - Show all images"); System.Console.WriteLine(" 3 - Show all specific user images"); System.Console.WriteLine(" 4 - Show all users with specific images"); System.Console.WriteLine(" 5 - Add new user"); System.Console.WriteLine(" 6 - -"); System.Console.WriteLine(" 7 - Add images to user"); System.Console.WriteLine(" 8 - Remove images from user"); System.Console.WriteLine(" 9 - Remove user"); System.Console.WriteLine("10 - -"); System.Console.WriteLine("11 - Update user"); System.Console.WriteLine("12 - Update image"); System.Console.WriteLine("13 - Exit"); System.Console.Write("Enter the number of menu: "); succes = int.TryParse(System.Console.ReadLine(), out menuNumber); System.Console.WriteLine(); } while (!succes); if (menuNumber > 0 && menuNumber < 13) { switch (menuNumber) { case 1: { ShowAllUsers(); } break; case 2: { ShowAllImages(); } break; case 3: { ShowImagesOfUser(); } break; case 4: { ShowUsersWithImages(); } break; case 5: { AddUser(); } break; case 6: { } break; case 7: { AddImageToUser(); } break; case 8: { DeleteImageFromUser(); } break; case 9: { DeleteUser(); } break; case 10: { } break; case 11: { UpdateUser(); } break; case 12: { UpdateImage(); } break; } } } while (menuNumber != 13); } catch { System.Console.WriteLine("Critical error"); System.Console.ReadLine(); } }
/// <summary> /// 构造方法注入依赖接口 /// </summary> /// <param name="iBaseBll"></param> public HomeController(IUsersBLL iUsersBll) { _iUsersBll = iUsersBll; }
public UsersController(IUsersBLL _iUsersBLL) { iUsersBLL = _iUsersBLL; }
public HomeController(IUserInfoDAL iuserinfodal,IUsersBLL usersBll) { _iuserInfoDal = iuserinfodal; _usersBll = usersBll; }
public HomeController(IUserInfoDAL iuserinfodal, IUsersBLL usersBll) { _iuserInfoDal = iuserinfodal; _usersBll = usersBll; }
public HomeController(IUsersBLL iUsersBll) { _iUsersBll = iUsersBll; }
public HomeController(IHlelloBLL iHlelloBll, IUsersBLL iUsersBll, IUserInfoBLL iuserInfoBll) { _iHlelloBll = iHlelloBll; _iUsersBll = iUsersBll; _iuserInfoBll = iuserInfoBll; }
public HomeController(IHlelloBLL iHlelloBll, IUsersBLL iUsersBll, IUserInfoBLL iuserInfoBll) { _iHlelloBll = iHlelloBll; _iUsersBll = iUsersBll; _iuserInfoBll = iuserInfoBll; }
public UsersController() { CRoot CompositionRoot = new CRoot("prod"); users_bll = CompositionRoot.UsersBLL; }
//Constructor: public AuthenticationController() { CRoot CompositionRoot = new CRoot("prod"); users_bll = CompositionRoot.UsersBLL; }