Ejemplo n.º 1
0
 public EditableListBox()
 {
     InitializeComponent();
     listboxHelper = new ListboxHelper(listbox);
     textboxHelper = new TextboxHelper(textbox);
     buttonsHelper = new ButtonsHelper(new Button[5] { buttonSort, buttonUp, buttonDown, buttonAdd, buttonRemove });
 }
Ejemplo n.º 2
0
        public ActionResult AddLocation(string Email)
        {
            ListboxHelper g = new ListboxHelper();
            Location l = new Location();
            l.getAllLocationTypes = g.GetAllLocationType();

            return View(l);
        }
Ejemplo n.º 3
0
 // GET: Users/User
 public ActionResult Index()
 {
     UserProfile model = new UserProfile();
     ListboxHelper g = new ListboxHelper();
     model.getAllGender = g.GetAllGender();
     model.getAllUserTypes = g.GetAllUserTypes();
     return View(model);
 }
Ejemplo n.º 4
0
 public EditableListBox()
 {
     InitializeComponent();
     listboxHelper = new ListboxHelper(listbox);
     textboxHelper = new TextboxHelper(textbox);
     buttonsHelper = new ButtonsHelper(new Button[5] {
         buttonSort, buttonUp, buttonDown, buttonAdd, buttonRemove
     });
 }
Ejemplo n.º 5
0
        public ActionResult Index(UserProfile model)
        {
            var client = new Connection().ConnectAmazonDynamoDB(new AmazonDBHelper().AmazonDBConnectionString());

            var table = Table.LoadTable(client, "user");
            var item = new Document();

            item["email"] = model.Email;
            item["password"] = model.Password;
            item["dob"] = model.DOB;
            item["firstname"] = model.FirstName;
            item["lastname"] = model.LastName;
            if (model.MiddleName != null && model.MiddleName != "")
                item["middlename"] = model.MiddleName;
            item["gender"] = model.GenderID;
            item["mobilephone"] = model.MobilePhone;
            item["usertype"] = model.UserTypeID;

            var licenses = new Document();
            if (model.LicenseExpireDate != null && model.LicenseExpireDate != "")
                licenses.Add("licenseexpiredate", model.LicenseExpireDate);
            if (model.LicenseIssueDate != null && model.LicenseIssueDate != "")
                licenses.Add("licenseissuedate", model.LicenseIssueDate);
            if (model.LicenseIssuePlace != null && model.LicenseIssuePlace != "")
                licenses.Add("licenseissueplace", model.LicenseIssuePlace);
            if (model.LicenseNumber != null && model.LicenseNumber != "")
                licenses.Add("licensenumber", model.LicenseNumber);
            item.Add("license", licenses);

            table.PutItem(item);

            ListboxHelper g = new ListboxHelper();
            model.getAllGender = g.GetAllGender();
            model.getAllUserTypes = g.GetAllUserTypes();
            return RedirectToAction("AddLocation", "User", new {Email = model.Email });
        }
Ejemplo n.º 6
0
        private Models.Prescription GetPrescription(int PatientID, int DoctorID, string InvoiceId, Models.Prescription model)
        {
            ListboxHelper g = new ListboxHelper();
            model.getAllPrescriptionTypes = g.GetAllPrescriptionType();
            model.Patient = GetUser(PatientID);
            model.Doctor = GetUser(DoctorID);
            model.PatientUserId = PatientID;
            model.PrescribedByUserId = DoctorID;
            model.InvoiceId = InvoiceId;
            List<Drug> Drugs = new List<Drug>();

            PrescriptionContext pc = new PrescriptionContext();
            IEnumerable<HealthDB.Model.Prescription> ps = from Prescriptions in pc.Prescriptions
                                                          where Prescriptions.Invoice == InvoiceId
                                                          select Prescriptions;

            foreach (var p in ps)
            {
                Drug d = new Drug();
                d.Id = p.Id;
                d.Direction = p.Instruction;
                d.DrugName = p.DrugName;
                d.GroupName = p.GroupName;
                d.PrescriptionType = (from PrescriptionTypes in pc.PrescriptionTypes
                                      where PrescriptionTypes.Id == p.PrescriptionTypeId
                                      select PrescriptionTypes.Name).FirstOrDefault();
                d.Quantity = p.Quantity;
                d.Strength = p.Dosage;
                Drugs.Add(d);
            }
            model.Drugs = Drugs.OrderBy(ds => ds.PrescriptionType + ds.GroupName + ds.DrugName).ToList();
            return model;
        }
Ejemplo n.º 7
0
 public bool InsertDrugName(string DrugName)
 {
     var result = new CRUD().getItem(new AmazonDBHelper().AmazonDBConnectionString(), "drugname", DrugName, ":v_drugname", "drugname");
     if (result.Count == 0)
     {
         int ID = 1;
         //Get ID
         List<ListboxHelper.CustomListItem> cli = new ListboxHelper().GetTableID();
         foreach (var li in cli)
         {
             if (li.text == "drugname")
             {
                 ID = li.value;
                 ID += 1;
             }
         }
         List<string> columnName = new List<string>();
         columnName.Add("id");
         columnName.Add("drugname");
         List<string> types = new List<string>();
         types.Add("int");
         types.Add("string");
         List<string> value = new List<string>();
         value.Add(ID.ToString());
         value.Add(DrugName.ToLower());
         new CRUD().InsertItem(new AmazonDBHelper().AmazonDBConnectionString(), "drugname", columnName, types, value);
     }
     return true;
 }
Ejemplo n.º 8
0
        private bool AddLocation(Location l)
        {
            int ID = 1;
            bool result = false;
            try
            {
                var client = new Connection().ConnectAmazonDynamoDB(new AmazonDBHelper().AmazonDBConnectionString());

                //Get ID
                List<ListboxHelper.CustomListItem> cli = new ListboxHelper().GetTableID();
                foreach (var li in cli)
                {
                    if (li.text == "Location")
                    {
                        ID = li.value;
                        ID += 1;
                    }
                }

                var table = Table.LoadTable(client, "location");
                var item = new Document();
                item["id"] = ID;

                item["city"] = l.City;
                item["postalcode"] = l.PostalCode;
                item["province"] = l.Province;
                item["street1"] = l.Street1;
                if (l.Street2 != null && l.Street2 != "")
                    item["street2"] = l.Street2;

                item["email"] = l.Email;
                item["locationtypeid"] = l.LocationTypeID;
                item["locname"] = l.LocName;


                if (l.LocFax != null && l.LocFax != "")
                    item["locfax"] = l.LocFax;
                item["locphone"] = l.LocPhoneMain;
              
                table.PutItem(item);

                new CRUD().UpdateItem(new AmazonDBHelper().AmazonDBConnectionString(), "GenerateID", "location", ":i", "ID", "#I", (ID + 1).ToString());
            }
            catch (Exception)
            {

            }
            return result;

        }