public int Insert(TOfficer TOfficer)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.TOfficers.Count() + 1;
            li.Login_Name     = TOfficer.TO_name;
            li.Login_Password = TOfficer.TO_password;
            li.Login_type     = "TOfficer";
            context.Logininfos.Add(li);
            context.TOfficers.Add(TOfficer);
            return(context.SaveChanges());
        }
        public int Insert(User User)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.Users.Count() + 1;
            li.Login_Name     = User.User_Name;
            li.Login_Password = User.User_password;
            li.Login_type     = "User";
            context.Logininfos.Add(li);

            context.Users.Add(User);
            return(context.SaveChanges());
        }
Exemplo n.º 3
0
        public int Insert(LoanOfficer LoanOfficer)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.LoanOfficers.Count() + 1;
            li.Login_Name     = LoanOfficer.LOfficer_name;
            li.Login_Password = LoanOfficer.LOfficer_Password;
            li.Login_type     = "LOfficer";
            context.Logininfos.Add(li);

            context.LoanOfficers.Add(LoanOfficer);
            return(context.SaveChanges());
        }
        public int Insert(MDirector MDirector)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.MDirectors.Count() + 1;
            li.Login_Name     = MDirector.MD_name;
            li.Login_Password = MDirector.MD_password;
            li.Login_type     = "MD";
            context.Logininfos.Add(li);

            context.MDirectors.Add(MDirector);
            return(context.SaveChanges());
        }
Exemplo n.º 5
0
        public int Insert(Admin admin)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.Admins.Count() + 1;
            li.Login_Name     = admin.Admin_Name;
            li.Login_Password = admin.Admin_password;
            li.Login_type     = "Admin";
            context.Logininfos.Add(li);

            context.Admins.Add(admin);

            return(context.SaveChanges());
        }
Exemplo n.º 6
0
        public int Insert(BranchManager branchMangaer)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.BranchManagers.Count() + 1;
            li.Login_Name     = branchMangaer.Manager_Name;
            li.Login_Password = branchMangaer.Manager_password;
            li.Login_type     = "Manager";
            context.Logininfos.Add(li);
            context.BranchManagers.Count();

            context.BranchManagers.Add(branchMangaer);
            return(context.SaveChanges());
        }
Exemplo n.º 7
0
        public int Update(Logininfo li)
        {
            Logininfo loToUpdate = context.Logininfos.SingleOrDefault(d => d.Login_Name == li.Login_Name);

            return(context.SaveChanges());
        }