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());
        }
示例#2
0
        public int Insert(Cashier cashier)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.Cashiers.Count() + 1;
            li.Login_Name     = cashier.Cashier_Name;
            li.Login_Password = cashier.Cashier_password;
            li.Login_type     = "Cashier";
            context.Logininfos.Add(li);

            context.Cashiers.Add(cashier);
            return(context.SaveChanges());
        }
示例#3
0
        public int Insert(Officer officer)
        {
            Logininfo li = new Logininfo();

            li.Login_acc_no   = context.Officers.Count() + 1;
            li.Login_Name     = officer.Officer_Name;
            li.Login_Password = officer.Officer_password;
            li.Login_type     = "Officer";
            context.Logininfos.Add(li);

            context.Officers.Add(officer);
            return(context.SaveChanges());
        }
示例#4
0
        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());
        }
        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(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());
        }
示例#7
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());
        }
示例#8
0
        public int Update(Logininfo li)
        {
            Logininfo loToUpdate = context.Logininfos.SingleOrDefault(d => d.Login_Name == li.Login_Name);

            return(context.SaveChanges());
        }