示例#1
0
        public bool EnterAccepterData(RegisterAccepter RA)
        {
            //Store Accepter Data To Database
            bool flag = false;

            try
            {
                EF_Database ctx = new EF_Database();
                Accepter    a   = new Accepter();
                a.NAME           = RA.AccepterName;
                a.REQUIREMENT    = RA.RequirementOrgon;
                a.AGE            = RA.AccepterAge;
                a.BLOOD_GROUP    = RA.BloodGroup;
                a.CONTACT_NUMBER = RA.Contact;
                a.DATE           = DateTime.Now;
                a.GENDER         = RA.DonorGender;
                a.LOCATION       = RA.Location;
                a.STATUS         = "Requested";

                Userinfo UI = new Userinfo();
                UI.USER_NAME = RA.Username;
                UI.PASSWORD  = RA.CPwd;
                UI.RoleId    = 4;
                a.USER_ID    = UI;
                ctx.Accepters.Add(a);
                ctx.SaveChanges();
                flag = true;
            }
            catch (Exception e)
            {
                throw new Exception("Error during Registering new Accepter");
            }
            return(flag);
        }
示例#2
0
        public bool EnterNomineeData(RegisterNominee RN)
        {
            //Store Nominee data into database
            bool flag = false;

            try
            {
                EF_Database ctx = new EF_Database();
                Nominee     N   = new Nominee();
                N.NOMINEE_NAME   = RN.NomineeName;
                N.DONOR_NAME     = RN.DonorName;
                N.DONOR_AGE      = RN.DonorAge;
                N.DATE           = DateTime.Now;
                N.DONOR_GENDER   = RN.DonorGender;
                N.LOCATION       = RN.Location;
                N.BLOOD_GROUP    = RN.BloodGroup;
                N.CONTACT_NUMBER = RN.Contact;
                N.STATUS         = "Submited";

                Userinfo UI = new Userinfo();
                UI.USER_NAME = RN.Username;
                UI.PASSWORD  = RN.CPwd;
                UI.RoleId    = 3;
                N.USER_ID    = UI;
                ctx.Nominees.Add(N);

                CasePool c = new CasePool();
                c.DonorId = N.NOMINEE_ID;
                c.STATUS  = "Initiated";


                ctx.CasePools.Add(c);
                //ctx.Userinfos.Add(UI);
                ctx.SaveChanges();
                flag = true;
            }
            catch (Exception e)
            {
                // Error.Message = e.Message;
                throw new Exception("Error during Registering new Nominee");
            }

            return(flag);
        }