Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (viewTxt.Text == "")
            {
                viewTxt.BackColor = Color.Red;
                return;
            }
            if (actionTxt.Text == "")
            {
                actionTxt.BackColor = Color.Red;
                return;
            }
            string id = Guid.NewGuid().ToString();

            _role = new Roles(id, titleTxt.Text, viewTxt.Text, actionTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);


            if (DBConnect.Insert(_role) != "")
            {
                titleTxt.Text  = "";
                actionTxt.Text = "";
                viewTxt.Text   = "";
                MessageBox.Show("Information Saved");
                LoadData();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 2
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (wardTxt.Text == "")
            {
                wardTxt.BackColor = Color.Red;
                return;
            }
            //if (Global._beds.Select(l=>l.No.Contains(bedTxt.Text) && l.WardID.Contains(wardTxt.Text)) {

            //    MessageBox.Show("Information already submitted !");
            //    return;
            //}

            string id = Guid.NewGuid().ToString();

            _bed = new Beds(id, wardTxt.Text, bedTxt.Text, accountTxt.Text, rateTxt.Text, statusTxt.Text, categoryTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_bed) != "")
            {
                Global._beds.Add(_bed);
                wardTxt.Text    = "";
                bedTxt.Text     = "";
                accountTxt.Text = "";
                MessageBox.Show("Information Saved");
                LoadData();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 3
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }

            string id = Guid.NewGuid().ToString();

            _clinic = new Clinics(id, nameTxt.Text, maxTxt.Text, minTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_clinic) != "")
            {
                Global._clinics.Add(_clinic);
                nameTxt.Text = "";
                maxTxt.Text  = "";
                minTxt.Text  = "";
                MessageBox.Show("Information Saved");
                LoadData();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            string paid   = "No";
            string status = "Incomplete";

            if (paidChk.Checked == true)
            {
                paid   = "Yes";
                status = "Complete";
            }
            if (Global._queues.Where(t => t.No.Contains(orderLbl.Text)).Count() > 0)
            {
                MessageBox.Show("Information already submitted  ");
                return;
            }
            if (patientID == "" || userID == "")
            {
                MessageBox.Show("Please input the input the patient OR the practitioner  ");
                return;
            }

            if (!String.IsNullOrEmpty(departmentCbx.Text))
            {
                Queue _q = new Queue(QueueID, next.ToString(), patientID, Helper.UserID, roomCbx.Text, "", Convert.ToDateTime(openedDate.Text).ToString("dd-MM-yyyy"), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), "", departmentCbx.Text, "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "", "", orderLbl.Text, Helper.orgID, departmentCbx.Text);
                DBConnect.Insert(_q);
                Global._queues.Add(_q);
                MessageBox.Show("Information added/Saved");
            }
        }
Ejemplo n.º 5
0
        private void myTreeView2_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (String.IsNullOrEmpty(PatientID))
            {
                MessageBox.Show("Please input the input the patient  ");
                return;
            }

            string paid   = "No";
            string status = "Incomplete";


            string OpId = myTreeView2.SelectedNode.Name.ToString();

            string id = Guid.NewGuid().ToString();

            if (!String.IsNullOrEmpty(OpId))
            {
                Services _service = new Services(id, myTreeView2.SelectedNode.Text.ToString(), orderLbl.Text, QueueID, Global._operations.First(s => s.Id.Contains(OpId)).DepID, OpId, PatientID, Helper.userID, Global._operations.First(s => s.Id.Contains(OpId)).Cost, Global._operations.First(s => s.Id.Contains(OpId)).Parameter, "Incomplete", "1", Global._operations.First(s => s.Id.Contains(OpId)).Cost, "No", "", "", DateTime.Now.ToString("dd-MM-yyyy"), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                DBConnect.Insert(_service);
                // Global._services.Add(_service);
                MessageBox.Show("Information added/Saved");
            }
            //}
            //catch { }
            LoadServices(orderLbl.Text);
        }
Ejemplo n.º 6
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (roomTxt.Text == "")
            {
                roomTxt.BackColor = Color.Red;
                return;
            }
            if (Global._rooms.Where(l => l.Name.Contains(roomTxt.Text)).Count() > 0)
            {
                MessageBox.Show("Information already submitted !");
                return;
            }

            string id = Guid.NewGuid().ToString();

            _room = new Room(id, roomTxt.Text, codeTxt.Text, userID, descriptionTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_room) != "")
            {
                Global._rooms.Add(_room);
                roomTxt.Text        = "";
                userID              = "";
                descriptionTxt.Text = "";
                MessageBox.Show("Information Saved");
                LoadData();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 7
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }

            string      id          = Guid.NewGuid().ToString();
            Departments _department = new Departments(id, nameTxt.Text, regTxt.Text, licenseTxt.Text, Convert.ToDateTime(openedDate.Text).ToString("dd-MM-yyyy"), codeTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_department) != "")
            {
                Global._departments.Add(_department);
                nameTxt.Text    = "";
                regTxt.Text     = "";
                licenseTxt.Text = "";
                MessageBox.Show("Information Saved");
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 8
0
        public ProfileForm(string orgID)
        {
            InitializeComponent();
            webcam = new WebCam();
            webcam.InitializeWebCam(ref imgVideo);
            autocomplete();
            string exists = "";

            try
            {
                exists = Organisation.ListOrganisation().First().Id;
            }
            catch { }
            if (String.IsNullOrEmpty(exists))
            {
                OrgID        = Guid.NewGuid().ToString();
                Helper.orgID = OrgID;
                MemoryStream stream    = ImageToStream(imgCapture.Image, System.Drawing.Imaging.ImageFormat.Jpeg);
                string       fullimage = ImageToBase64(stream);
                _org = new Organisation(OrgID, nameTxt.Text, codeTxt.Text, registrationTxt.Text, contactTxt.Text, addressTxt.Text, tinTxt.Text, vatTxt.Text, emailTxt.Text, nationalityTxt.Text, "", accountTxt.Text, statusCbx.Text, DateTime.Now.AddMonths(3).ToString("dd-MM-yyyy"), fullimage, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), countsTxt.Text, companyCode.Text, "");
                DBConnect.Insert(_org);
            }
            else
            {
                Helper.orgID = exists;
                OrgID        = exists;
                Profile(exists);
            }
            LoadStores();
        }
Ejemplo n.º 9
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (titleTxt.Text == "")
            {
                titleTxt.BackColor = Color.Red;
                return;
            }

            string id = Guid.NewGuid().ToString();

            _category = new Category(id, titleTxt.Text, docTxt.Text, hosTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_category) != "")
            {
                Global._categories.Add(_category);
                titleTxt.Text = "";
                docTxt.Text   = "";
                hosTxt.Text   = "";
                MessageBox.Show("Information Saved");
                LoadData();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 10
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }
            if (addressTxt.Text == "")
            {
                addressTxt.BackColor = Color.Red;
                return;
            }

            string id      = Guid.NewGuid().ToString();
            Branch _branch = new Branch(id, nameTxt.Text, locationTxt.Text, addressTxt.Text, contactTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID, codeTxt.Text);

            if (DBConnect.Insert(_branch) != "")
            {
                Global._branch.Add(_branch);
            }
            nameTxt.Text     = "";
            addressTxt.Text  = "";
            locationTxt.Text = "";
            MessageBox.Show("Information Saved");
            this.DialogResult = DialogResult.OK;
            this.Dispose();
        }
Ejemplo n.º 11
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }

            string     id          = Guid.NewGuid().ToString();
            Discipline _discipline = new Discipline(id, nameTxt.Text, codeTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_discipline) != "")
            {
                Global._disciplines.Add(_discipline);
                nameTxt.Text = "";
                codeTxt.Text = "";

                MessageBox.Show("Information Saved");
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 12
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }

            string id = Guid.NewGuid().ToString();

            _procedure = new Procedures(id, nameTxt.Text, categoryTxt.Text, rolesCbx.Text, costTxt.Text, departmentCbx.Text, durationTxt.Text, codeTxt.Text, genderCbx.Text, descriptionTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_procedure) != "")
            {
                Global._procedures.Add(_procedure);
                nameTxt.Text     = "";
                costTxt.Text     = "";
                durationTxt.Text = "";
                MessageBox.Show("Information Saved");
                LoadData();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 13
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }

            string id = Guid.NewGuid().ToString();

            if (chronicBtn.Checked == true)
            {
                _chronic = new Chronic(id, nameTxt.Text, descriptionTxt.Text, PatientID, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                DBConnect.Insert(_chronic);
            }
            if (allergyBtn.Checked == true)
            {
                _allergy = new Allergy(id, nameTxt.Text, descriptionTxt.Text, PatientID, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                DBConnect.Insert(_allergy);
            }
            if (additBtn.Checked == true)
            {
                _addiction = new Addiction(id, nameTxt.Text, descriptionTxt.Text, PatientID, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                DBConnect.Insert(_addiction);
            }
            nameTxt.Text        = "";
            descriptionTxt.Text = "";

            MessageBox.Show("Information Saved");
            LoadAddiction(PatientID);
            LoadAllergy(PatientID);
            LoadChronic(PatientID);
        }
Ejemplo n.º 14
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }

            string id = Guid.NewGuid().ToString();

            _ward = new Wards(id, nameTxt.Text, codeTxt.Text, capacityTxt.Text, costTxt.Text, depositTxt.Text, wingTxt.Text, periodTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_ward) != "")
            {
                Global._wards.Add(_ward);
                nameTxt.Text     = "";
                codeTxt.Text     = "";
                capacityTxt.Text = "";
                MessageBox.Show("Information Saved");
                LoadData();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 15
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (surnameTxt.Text == "")
            {
                errorList.Add("Missing surname");
                surnameTxt.BackColor = Color.Red;
                return;
            }
            if (lastnameTxt.Text == "")
            {
                errorList.Add("Missing last name");
                lastnameTxt.BackColor = Color.Red;
                return;
            }

            string id = Guid.NewGuid().ToString();

            MemoryStream stream    = ImageToStream(imgCapture.Image, System.Drawing.Imaging.ImageFormat.Jpeg);
            string       fullimage = ImageToBase64(stream);

            _patient = new Patient(id, patientNoTxt.Text, contactTxt.Text, surnameTxt.Text, lastnameTxt.Text, emailTxt.Text, dobdateTimePicker1.Text, nationalityTxt.Text, addressTxt.Text, kinTxt.Text, kincontactTxt.Text, genderCbx.Text, fullimage, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), religionCbx.Text, bloodCbx.Text, Helper.orgID);

            if (DBConnect.Insert(_patient) != "")
            {
                //string query = "insert into patient (id, patientNo,contact,surname,lastname,email,dob,nationality,address,kin,kincontact,gender,created) values ('"+ id + "', '"+ patientNoTxt.Text + "', '"+ contactTxt.Text + "', '" + surnameTxt.Text + "', '" + lastnameTxt.Text + "', '" + emailTxt.Text + "', '" +Convert.ToDateTime(dobdateTimePicker1.Text).ToString("dd-MM-yyyy") + "', '" + nationalityTxt.Text + "', '" + addressTxt.Text + "', '" + kinTxt.Text + "','" + kincontactTxt.Text + "', '" + genderCbx.Text + "','"+DateTime.Now.ToString("dd-MM-yyyy H:m:s")+"');";
                Global._patients.Add(_patient);
                MessageBox.Show("Information Saved");
            }
            else
            {
            }
        }
Ejemplo n.º 16
0
        private void button2_Click_3(object sender, EventArgs e)
        {
            string id = "";

            id = Guid.NewGuid().ToString();
            if (!String.IsNullOrEmpty(diagnosisCbx.Text))
            {
                Diagnosis _diag = new Diagnosis(id, diagnosisCbx.Text, visitLbl.Text, queueID, PatientID, codeTxt.Text, treatmentTxt.Text, consultTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID, Helper.UserID);
                DBConnect.Insert(_diag);
                MessageBox.Show("Information added/Saved");
                LoadDiagnosis(visitLbl.Text);
            }
        }
Ejemplo n.º 17
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(QueueNo))
            {
                MessageBox.Show("Please select the current a number ");
                return;
            }

            string id = "";

            id = Guid.NewGuid().ToString();
            if (!String.IsNullOrEmpty(labCbx.Text))
            {
                _lab = new Lab(id, QueueID, PatientID, labCbx.Text, labCostTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), labQty.Text, LabTotal.ToString("n0"), Helper.orgID, QueueNo);
                DBConnect.Insert(_lab);
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
        }
Ejemplo n.º 18
0
        private void saveBtn_Click_1(object sender, EventArgs e)
        {
            if (serviceTxt.Text == "")
            {
                serviceTxt.BackColor = Color.Red;
                return;
            }
            string     id         = Guid.NewGuid().ToString();
            Operations _operation = new Operations(id, depID, codeTxt.Text, serviceTxt.Text, typeTxt.Text, categoryTxt.Text, costTxt.Text, speID, parameterTxt.Text, upperTxt.Text, lowerTxt.Text, measureTxt.Text, desID, genderCbx.Text, phraseTxt.Text, maxTxt.Text, minTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            if (DBConnect.Insert(_operation) != "")
            {
                Global._operations.Add(_operation);
                MessageBox.Show("Information Saved");
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 19
0
        private void myTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            string paid   = "No";
            string status = "Incomplete";

            if (paidChk.Checked == true)
            {
                paid   = "Yes";
                status = "Complete";
            }
            if (String.IsNullOrEmpty(patientID))
            {
                MessageBox.Show("Please input the input the patient  ");
                return;
            }
            if (String.IsNullOrEmpty(userID))
            {
                MessageBox.Show("Please input the input the practitioner  ");
                return;
            }
            if (Global._queues.Where(t => t.No.Contains(orderLbl.Text)).Count() < 1)
            {
                MessageBox.Show("Please save /Submit the visit information");
                return;
            }
            string OpId = myTreeView.SelectedNode.Tag.ToString();

            string id = "";

            id = Guid.NewGuid().ToString();
            if (!String.IsNullOrEmpty(OpId))
            {
                Services _service = new Services(id, myTreeView.SelectedNode.Name.ToString(), orderLbl.Text, QueueID, Global._operations.First(s => s.Id.Contains(OpId)).DepID, OpId, patientID, Helper.userID, Global._operations.First(s => s.Id.Contains(OpId)).Cost, Global._operations.First(s => s.Id.Contains(OpId)).Parameter, "Incomplete", "1", Global._operations.First(s => s.Id.Contains(OpId)).Cost, "No", "", "", DateTime.Now.ToString("dd-MM-yyyy"), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                DBConnect.Insert(_service);
                // Global._services.Add(_service);
                MessageBox.Show("Information added/Saved");
            }
            LoadServices(orderLbl.Text);
        }
Ejemplo n.º 20
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(noteID))
            {
                if (MessageBox.Show("YES or No?", "Would you want to update these notes? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    _note = new Notes(noteID, queueID, PatientID, PractitionerID, consultTxt.Text, consultTxt.Text, treatmentTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                    DBConnect.Update(_note, noteID);
                    MessageBox.Show("Information updated ");
                }
                return;
            }

            string id = Guid.NewGuid().ToString();

            if (!String.IsNullOrEmpty(consultTxt.Text) && !String.IsNullOrEmpty(consultTxt.Text))
            {
                _note = new Notes(id, queueID, PatientID, PractitionerID, consultTxt.Text, consultTxt.Text, treatmentTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                DBConnect.Insert(_note);
                LoadNotes(queueID);
                MessageBox.Show("Information saved ");
            }
        }
Ejemplo n.º 21
0
 private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     try
     {
         string      path       = Environment.CurrentDirectory + "\\icd10.txt";
         const Int32 BufferSize = 1024;
         using (var fileStream = File.OpenRead(path))
             using (var streamReader = new StreamReader(fileStream, Encoding.UTF8, true, BufferSize))
             {
                 while ((line = streamReader.ReadLine()) != null)
                 {
                     //  FeedBack(line);
                     Console.WriteLine(line);
                     string[] sections     = line.Split(' ');
                     string   descriptions = "";
                     for (int i = 1; i < sections.Count(); i++)
                     {
                         descriptions = descriptions + " " + sections[i];
                     }
                     string id = Guid.NewGuid().ToString();
                     _cd10 = new Cd10(id, sections[0], Helper.CleanString(descriptions), " ", " ", DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                     if (Global._cds.Where(h => h.Code.Contains(sections[0])).Count() < 1)
                     {
                         DBConnect.Insert(_cd10);
                     }
                     else
                     {
                         Console.WriteLine("Already saved " + line);
                     }
                 }
             }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 22
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }
            if (contactTxt.Text == "")
            {
                contactTxt.BackColor = Color.Red;
                return;
            }
            if (typeCbx.Text == "")
            {
                typeCbx.BackColor = Color.Red;
                return;
            }

            string id = Guid.NewGuid().ToString();

            MemoryStream stream    = ImageToStream(imgCapture.Image, System.Drawing.Imaging.ImageFormat.Jpeg);
            string       fullimage = ImageToBase64(stream);

            _transactor = new Transactor(id, noTxt.Text, contactTxt.Text, nameTxt.Text, emailTxt.Text, addressTxt.Text, fullimage, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), typeCbx.Text, Helper.orgID);

            if (DBConnect.Insert(_transactor) != "")
            {
                //string query = "insert into patient (id, patientNo,contact,surname,lastname,email,dob,nationality,address,kin,kincontact,gender,created) values ('"+ id + "', '"+ patientNoTxt.Text + "', '"+ contactTxt.Text + "', '" + surnameTxt.Text + "', '" + lastnameTxt.Text + "', '" + emailTxt.Text + "', '" +Convert.ToDateTime(dobdateTimePicker1.Text).ToString("dd-MM-yyyy") + "', '" + nationalityTxt.Text + "', '" + addressTxt.Text + "', '" + kinTxt.Text + "','" + kincontactTxt.Text + "', '" + genderCbx.Text + "','"+DateTime.Now.ToString("dd-MM-yyyy H:m:s")+"');";
                // Global._patients.Add(_patient);
                MessageBox.Show("Information Saved");
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
            else
            {
            }
        }
Ejemplo n.º 23
0
        public PractitionerRegistration()
        {
            InitializeComponent();
            webcam = new WebCam();
            webcam.InitializeWebCam(ref imgVideo);
            autocomplete();

            if (Global._roles.Count() < 1)
            {
                string ids   = Guid.NewGuid().ToString();
                Roles  _role = new Roles(ids, "Administrator", "All item pos daily purchases merchandise inventory expenses cash flow suppliers users suppliers catgories transactions ledgers logs profile ", "create update delete log ", DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                DBConnect.Insert(_role);
                Global._roles.Add(_role);
            }
            foreach (Roles r in Global._roles)
            {
                rolesCbx.Items.Add(r.Title);
            }
            foreach (Departments d in Global._departments)
            {
                departmentCbx.Items.Add(d.Name);
                departmentDictionary.Add(d.Name, d.Id);
            }
        }
Ejemplo n.º 24
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            if (surnameTxt.Text == "")
            {
                errorList.Add("Missing surname");
                surnameTxt.BackColor = Color.Red;
                UpdateErrors();
                return;
            }
            if (lastnameTxt.Text == "")
            {
                errorList.Add("Missing last name");
                lastnameTxt.BackColor = Color.Red;
                UpdateErrors();
                return;
            }
            if (pass2Txt.Text != passTxt.Text)
            {
                errorList.Add("passwords do not match");
                passTxt.BackColor = Color.Red;
                UpdateErrors();
                return;
            }
            if (String.IsNullOrEmpty(passTxt.Text))
            {
                errorList.Add("please insert password !");
                passTxt.BackColor = Color.Red;
                UpdateErrors();
                return;
            }
            string role = "";

            if (mainRadioBtn.Checked)
            {
                role = "Main";
            }
            else if (subRadioBtn.Checked)
            {
                role = "Sub";
            }
            else
            {
                role = "Other";
            }


            string       id        = Guid.NewGuid().ToString();
            MemoryStream stream    = ImageToStream(imgCapture.Image, System.Drawing.Imaging.ImageFormat.Jpeg);
            string       fullimage = ImageToBase64(stream);

            _user = new Users(id, patientNoTxt.Text, contactTxt.Text, contact2Txt.Text, surnameTxt.Text, lastnameTxt.Text, emailTxt.Text, nationalityTxt.Text, addressTxt.Text, kinTxt.Text, kincontactTxt.Text, Helper.MD5Hash(pass2Txt.Text), designationCbx.Text, rolesCbx.Text, genderCbx.Text, fullimage, clinicnameTxt.Text, role, Helper.MD5Hash(passTxt.Text), accountTxt.Text, statusCbx.Text, practiceTxt.Text, specialisationTxt.Text, subTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:m:s"), departmentCbx.Text, Helper.orgID);

            if (DBConnect.Insert(_user) != "")
            {
                Global._users.Add(_user);
                //DBConnect.saveImage("users", fullimage, id);
                MessageBox.Show("Information Saved");



                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
            else
            {
            }
        }
Ejemplo n.º 25
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }

            if (saleTxt.Text == "")
            {
                saleTxt.BackColor = Color.Red;
                return;
            }
            if (qtyTxt.Text == "")
            {
                qtyTxt.BackColor = Color.Red;
                return;
            }
            if (purchaseTxt.Text == "")
            {
                purchaseTxt.BackColor = Color.Red;
                return;
            }
            if (!String.IsNullOrEmpty(ItemID))
            {
                if (Global._items.Where(t => t.Id.Contains(ItemID)).ToList().Count() < 1)
                {
                    MemoryStream stream    = ImageToStream(imgCapture.Image, System.Drawing.Imaging.ImageFormat.Jpeg);
                    string       fullimage = ImageToBase64(stream);
                    _item = new Item(ItemID, nameTxt.Text, codeTxt.Text, descriptionTxt.Text, mannufacturerTxt.Text, ctryTxt.Text, batchTxt.Text, purchaseTxt.Text, saleTxt.Text, compositionTxt.Text, Convert.ToDateTime(expireDate.Text).ToString("dd-MM-yyyy"), categoryCbx.Text, packageCbx.Text, barcodeTxt.Text, fullimage, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), departmentCbx.Text, Convert.ToDateTime(manufactureDate.Text).ToString("dd-MM-yyyy"), genericTxt.Text, strengthTxt.Text, Helper.orgID);

                    if (DBConnect.Insert(_item) != "")
                    {
                        if (Global._stocks.Where(t => t.ItemID.Contains(ItemID)).Count() > 0)
                        {
                            double value = 0;
                            string qty   = Global._stocks.First(t => t.ItemID.Contains(ItemID)).Quantity;
                            value = Convert.ToDouble(qty) + Convert.ToDouble(qtyTxt.Text);

                            string itemID = Global._stocks.First(t => t.ItemID.Contains(ItemID)).ItemID;
                            string SQL    = "UPDATE stock SET qty = '" + value + "', WHERE itemID = '" + itemID + "'";
                            DBConnect.Execute(SQL);
                        }
                        else
                        {
                            double totalQty = Convert.ToDouble(purchaseTxt.Text) * Convert.ToDouble(qtyTxt.Text);
                            string id       = Guid.NewGuid().ToString();
                            _stock = new Stock(id, ItemID, qtyTxt.Text, descriptionTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), saleTxt.Text, purchaseTxt.Text, purchaseTxt.Text, purchaseTxt.Text, totalQty.ToString(), Helper.orgID);
                            DBConnect.Insert(_stock);
                            Global._stocks.Add(_stock);
                        }

                        if (Global._transactors.Where(t => t.Id.Contains(SupplierID)).Count() < 0)
                        {
                            MemoryStream streams    = ImageToStream(pictureBox1.Image, System.Drawing.Imaging.ImageFormat.Jpeg);
                            string       fullimages = ImageToBase64(streams);
                            string       id         = Guid.NewGuid().ToString();
                            _transactor = new Transactor(id, supplierNoTxt.Text, contactTxt.Text, supplierTxt.Text, emailTxt.Text, addressTxt.Text, fullimages, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), "Supplier", Helper.orgID);
                            DBConnect.Insert(_transactor);
                            SupplierID = id;
                        }


                        if (!String.IsNullOrEmpty(noTxt.Text) && !String.IsNullOrEmpty(SupplierID))
                        {
                            string id = Guid.NewGuid().ToString();
                            _bill = new Bill(id, noTxt.Text, SupplierID, remarksTxt.Text, purchaseDate.Text, purchaseTxt.Text, balanceTxt.Text, methodCbx.Text, paidCbx.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), departmentCbx.Text, Convert.ToDateTime(dueDate.Text).ToString("dd-MM-yyyy"), chqTxt.Text, bankTxt.Text, "Purchase", "", "", Helper.orgID);
                            DBConnect.Insert(_bill);
                            string id2 = Guid.NewGuid().ToString();
                            _transaction = new Transaction(id2, noTxt.Text, ItemID, qtyTxt.Text, Convert.ToDateTime(purchaseDate.Text).ToString("dd-MM-yyyy"), purchaseTxt.Text, "Purchase", DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                            DBConnect.Insert(_transaction);
                        }

                        if (Global._dosages.Where(t => t.ItemID.Contains(ItemID)).Count() < 0)
                        {
                            string id = Guid.NewGuid().ToString();
                            _dosage = new Dosage(id, ItemID, doseTxt.Text, prescriptionTxt.Text, dosageQtyTxt.Text, minTxt.Text, maxTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
                            DBConnect.Insert(_dosage);
                        }

                        Global._items.Add(_item);
                        MessageBox.Show("Information Saved");
                        this.DialogResult = DialogResult.OK;
                        this.Dispose();
                    }
                    else
                    {
                        MessageBox.Show("No valid Item identification ");
                    }
                }
            }
        }
Ejemplo n.º 26
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (Users.ListUsers().Count() < 1)
                {
                    MessageBox.Show("Please add atleast a single user");
                    return;
                }
            }
            catch
            {
                return;
            }
            if (Branch.ListBranch().Count() < 1)
            {
                MessageBox.Show("Please add a branch");
                return;
            }
            if (String.IsNullOrEmpty(Helper.BranchID))
            {
                MessageBox.Show("Please select a store/Shop");
                storeCbx.BackColor = Color.Red;
                return;
            }
            string password = "";

            if (nameTxt.Text == "")
            {
                nameTxt.BackColor = Color.Red;
                return;
            }
            if (codeTxt.Text == "")
            {
                codeTxt.BackColor = Color.Red;
                return;
            }
            if (initialTxt.Text != "")
            {
                password = Helper.MD5Hash(initialTxt.Text);
            }
            else
            {
                password = originalPassword;
            }
            string id = Guid.NewGuid().ToString();

            MemoryStream stream    = ImageToStream(imgCapture.Image, System.Drawing.Imaging.ImageFormat.Jpeg);
            string       fullimage = ImageToBase64(stream);

            _org = new Organisation(id, nameTxt.Text, codeTxt.Text, registrationTxt.Text, contactTxt.Text, addressTxt.Text, tinTxt.Text, vatTxt.Text, emailTxt.Text, nationalityTxt.Text, password, accountTxt.Text, statusCbx.Text, Convert.ToDateTime(expireDate.Text).ToString("dd-MM-yyyy"), fullimage, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), countsTxt.Text, companyCode.Text, Helper.BranchID);
            DBConnect.Update(_org, OrgID);
            Helper.orgID = OrgID;
            DBConnect.Update(_org, OrgID);
            MessageBox.Show("Information Updated ");
            Close();

            string SQL = "UPDATE organisation SET counts = '" + DateTime.Now.ToString("dd-MM-yyyy H:mm:ss") + "' WHERE id= '" + id + "'";

            DBConnect.Execute(SQL);
            MessageBox.Show("Information Saved");
            Close();
            if (Global._users.Count() < 1)
            {
                Helper.orgID = id;
                string ids = Guid.NewGuid().ToString();
                _role = new Roles(ids, "Administrator", "All item pos daily purchases merchandise inventory expenses cash flow suppliers users suppliers catgories transactions ledgers logs profile ", "create update delete log ", DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

                DBConnect.Insert(_role);
                Global._roles.Add(_role);
            }
            this.DialogResult = DialogResult.OK;
            this.Dispose();
            nameTxt.Text = "";
            codeTxt.Text = "";
        }