Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            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;
            }
            Helper.BranchID = storeDictionary[storeCbx.Text];
            if (storeCbx.Text == "")
            {
                storeCbx.BackColor = Color.PaleVioletRed;
                return;
            }
            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, Convert.ToDateTime(expireDate.Text).ToString("dd-MM-yyyy"), fullimage, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Convert.ToDateTime(syncDate.Text).ToString("dd-MM-yyyy H:mm:ss"), countsTxt.Text, companyCode.Text, Helper.BranchID);
            if (OrgID != "")
            {
                DBConnect.Update(_org, OrgID);
                MessageBox.Show("Information Updated ");
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
        }
Beispiel #2
0
        private void dtGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            updateID = dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString();

            if (e.ColumnIndex == 1)
            {
                if (MessageBox.Show("YES or No?", "Is visit complete? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    //Global._queues.RemoveAll(x => x.Id == updateID);
                    //DBConnect.Delete("queue", dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString());
                    _queue = new Queue(updateID, _queues.First(x => x.Id.Contains(updateID)).Follow, _queues.First(x => x.Id.Contains(updateID)).PatientID, _queues.First(x => x.Id.Contains(updateID)).UserID, _queues.First(x => x.Id.Contains(updateID)).RoomID, _queues.First(x => x.Id.Contains(updateID)).ClinicID, "Complete", _queues.First(x => x.Id.Contains(updateID)).Dated, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), _queues.First(x => x.Id.Contains(updateID)).Department, "", "", "", "", "", "", "", "", "", Helper.orgID, dtGrid.Rows[e.RowIndex].Cells["type"].Value.ToString());

                    DBConnect.Update(_queue, updateID);
                    Global._queues.RemoveAll(x => x.Id == updateID);
                    Global._queues.Add(_queue);
                    MessageBox.Show("Information updated");
                    LoadData();
                }
            }

            if (e.ColumnIndex == 0)
            {
                string visitID        = dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString();
                string patientID      = dtGrid.Rows[e.RowIndex].Cells[14].Value.ToString();
                string practitionerID = dtGrid.Rows[e.RowIndex].Cells[15].Value.ToString();

                PatientVisit frm = new PatientVisit(visitID, patientID, practitionerID);
                frm.MdiParent = MainForm.ActiveForm;
                frm.Dock      = DockStyle.Fill;
                frm.Show();
            }
        }
Beispiel #3
0
        private void dtAddict_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            string updateID = dtAddict.Rows[e.RowIndex].Cells[0].Value.ToString();

            _addiction = new Addiction(updateID, dtAddict.Rows[e.RowIndex].Cells[1].Value.ToString(), dtAddict.Rows[e.RowIndex].Cells[2].Value.ToString(), PatientID, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);
            DBConnect.Update(_addiction, updateID);
        }
Beispiel #4
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            if (updateID == "")
            {
                return;
            }
            if (MessageBox.Show("YES or No?", "Are you sure you want to update this information? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                //string SQL = "UPDATE tests SET name = '" + nameTxt.Text + "',mins='" + minTxt.Text + "',maxs= '" + maxTxt.Text + "' WHERE id= '" + updateID + "'";
                _test = new Tests(updateID, specimenCbx.Text, typeCbx.Text, nameTxt.Text, upperTxt.Text, lowerTxt.Text, unitTxt.Text, desciplineCbx.Text, codeTxt.Text, genderCbx.Text, phraseTxt.Text, descriptionTxt.Text, commentTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), costTxt.Text, departmentID, Helper.orgID);

                DBConnect.Update(_test, updateID);
                Global._tests.RemoveAll(x => x.Id == updateID);
                Global._tests.Add(_test);
                // DBConnect.Execute(SQL);
                MessageBox.Show("Information updated");
                saveBtn.Visible   = true;
                updateBtn.Visible = false;
                updateID          = "";
                nameTxt.Text      = "";
                upperTxt.Text     = "";
                phraseTxt.Text    = "";
                LoadData();
            }
        }
Beispiel #5
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            if (updateID == "")
            {
                return;
            }
            if (MessageBox.Show("YES or No?", "Are you sure you want to update this information? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                //string SQL = "UPDATE procedures SET name = '" + nameTxt.Text + "',mins='" + minTxt.Text + "',maxs= '" + maxTxt.Text + "' WHERE id= '" + updateID + "'";
                _procedure = new Procedures(updateID, 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);

                DBConnect.Update(_procedure, updateID);
                Global._procedures.RemoveAll(x => x.Id == updateID);
                Global._procedures.Add(_procedure);
                // DBConnect.Execute(SQL);
                MessageBox.Show("Information updated");
                saveBtn.Visible   = true;
                updateBtn.Visible = false;
                updateID          = "";
                nameTxt.Text      = "";
                costTxt.Text      = "";
                durationTxt.Text  = "";
                LoadData();
            }
        }
Beispiel #6
0
        private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (String.IsNullOrEmpty(dtGrid.Rows[e.RowIndex].Cells["Quantity"].Value.ToString()) || String.IsNullOrEmpty(dtGrid.Rows[e.RowIndex].Cells["Price"].Value.ToString()))
            {
                MessageBox.Show("Please input a value ");
                return;
            }
            if (e.ColumnIndex == dtGrid.Columns["Quantity"].Index || e.ColumnIndex == dtGrid.Columns["Price"].Index)
            {
                try
                {
                    dtGrid.Rows[e.RowIndex].Cells["Total"].Value = (Convert.ToDouble(dtGrid.Rows[e.RowIndex].Cells["Quantity"].Value) * Convert.ToDouble(dtGrid.Rows[e.RowIndex].Cells["Price"].Value));
                }
                catch
                {
                }
            }
            Services _c = new Services(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["name"].Value.ToString(), No, VisitID, dtGrid.Rows[e.RowIndex].Cells["departmentID"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["name"].Value.ToString(), PatientID, Helper.userID, dtGrid.Rows[e.RowIndex].Cells["price"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["parameter"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["status"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["Quantity"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["Total"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["Paid"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["notes"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["results"].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy"), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            DBConnect.Update(_c, dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString());
            try
            {
                LoadServices(No);
            }
            catch { }
        }
Beispiel #7
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            if (updateID == "")
            {
                return;
            }
            if (MessageBox.Show("YES or No?", "Are you sure you want to update this information? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                //string SQL = "UPDATE clinics SET name = '" + nameTxt.Text + "',mins='" + minTxt.Text + "',maxs= '" + maxTxt.Text + "' WHERE id= '" + updateID + "'";
                _clinic = new Clinics(updateID, nameTxt.Text, maxTxt.Text, minTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

                DBConnect.Update(_clinic, updateID);
                Global._clinics.RemoveAll(x => x.Id == updateID);
                Global._clinics.Add(_clinic);
                // DBConnect.Execute(SQL);
                MessageBox.Show("Information updated");
                saveBtn.Visible   = true;
                updateBtn.Visible = false;
                updateID          = "";
                nameTxt.Text      = "";
                maxTxt.Text       = "";
                minTxt.Text       = "";
                LoadData();
            }
        }
Beispiel #8
0
 private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
 {
     updateID = dtGrid.Rows[e.RowIndex].Cells[1].Value.ToString();
     _test    = new Tests(updateID, dtGrid.Rows[e.RowIndex].Cells[2].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[4].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[5].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[6].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[7].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[8].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[9].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[10].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[11].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[12].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[13].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), dtGrid.Rows[e.RowIndex].Cells[15].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[16].Value.ToString(), Helper.orgID);
     //Tests(2, 4, 5,6,7, 8, string created)
     DBConnect.Update(_test, updateID);
     Global._tests.RemoveAll(x => x.Id == updateID);
     Global._tests.Add(_test);
 }
Beispiel #9
0
        private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            updateID = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString();
            _users   = new Users(updateID, dtGrid.Rows[e.RowIndex].Cells[5].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[8].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[9].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[6].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[7].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[10].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[11].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[12].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[13].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[14].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[27].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[18].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[28].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[15].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[17].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[21].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[22].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[29].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[20].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[23].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[24].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[25].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[26].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), dtGrid.Rows[e.RowIndex].Cells[31].Value.ToString(), Helper.orgID);

            DBConnect.Update(_users, updateID);
            Global._users.RemoveAll(x => x.Id == updateID);
            Global._users.Add(_users);
        }
Beispiel #10
0
        private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            updateID    = dtGrid.Rows[e.RowIndex].Cells[2].Value.ToString();
            _discipline = new Discipline(dtGrid.Rows[e.RowIndex].Cells[2].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[4].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[5].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            DBConnect.Update(_discipline, updateID);
            Global._disciplines.RemoveAll(x => x.Id == updateID);
            Global._disciplines.Add(_discipline);
        }
Beispiel #11
0
        private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            updateID = dtGrid.Rows[e.RowIndex].Cells[2].Value.ToString();
            _ward    = new Wards(dtGrid.Rows[e.RowIndex].Cells[2].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[4].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[5].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[6].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[7].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[8].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[9].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[10].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            DBConnect.Update(_ward, updateID);
            Global._wards.RemoveAll(x => x.Id == updateID);
            Global._wards.Add(_ward);
        }
Beispiel #12
0
        private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            updateID = dtGrid.Rows[e.RowIndex].Cells[1].Value.ToString();
            _patient = new Patient(updateID, dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[6].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[4].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[5].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[7].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[8].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[9].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[10].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[11].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[12].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[13].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[15].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), dtGrid.Rows[e.RowIndex].Cells[17].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[16].Value.ToString(), Helper.orgID);

            DBConnect.Update(_patient, updateID);
            Global._patients.RemoveAll(x => x.Id == updateID);
            Global._patients.Add(_patient);
        }
Beispiel #13
0
        private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            updateID  = dtGrid.Rows[e.RowIndex].Cells[1].Value.ToString();
            _specimen = new Specimens(updateID, dtGrid.Rows[e.RowIndex].Cells[2].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells[4].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            DBConnect.Update(_specimen, updateID);
            Global._specimens.RemoveAll(x => x.Id == updateID);
            Global._specimens.Add(_specimen);
        }
Beispiel #14
0
        private void dtGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            updateID = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString();
            Operations _operation = new Operations(updateID, dtGrid.Rows[e.RowIndex].Cells["depID"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["code"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["service"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["type"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["category"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["cost"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["specimenID"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["parameter"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["upper"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["lower"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["unit"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["disciplineID"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["gender"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["phrase"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["max"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["min"].Value.ToString(), DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

            //Operations(2, 4, 5,6,7, 8, string created)
            DBConnect.Update(_operation, updateID);
            Global._operations.RemoveAll(x => x.Id == updateID);
            Global._operations.Add(_operation);
        }
Beispiel #15
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 ");
            }
        }
Beispiel #16
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            if (updateID == "")
            {
                return;
            }
            if (MessageBox.Show("YES or No?", "Are you sure you want to update this information? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                _bed = new Beds(updateID, wardTxt.Text, bedTxt.Text, accountTxt.Text, rateTxt.Text, statusTxt.Text, categoryTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

                DBConnect.Update(_bed, updateID);
                Global._beds.RemoveAll(x => x.Id == updateID);
                Global._beds.Add(_bed);
                // DBConnect.Execute(SQL);
                MessageBox.Show("Information updated");
                saveBtn.Visible   = true;
                updateBtn.Visible = false;
                updateID          = "";
                wardTxt.Text      = "";
                bedTxt.Text       = "";
                accountTxt.Text   = "";
                LoadData();
            }
        }
Beispiel #17
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            if (updateID == "")
            {
                return;
            }
            if (MessageBox.Show("YES or No?", "Are you sure you want to update this information? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                _ward = new Wards(updateID, 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);

                DBConnect.Update(_ward, updateID);
                Global._wards.RemoveAll(x => x.Id == updateID);
                Global._wards.Add(_ward);
                // DBConnect.Execute(SQL);
                MessageBox.Show("Information updated");
                saveBtn.Visible   = true;
                updateBtn.Visible = false;
                updateID          = "";
                nameTxt.Text      = "";
                codeTxt.Text      = "";
                capacityTxt.Text  = "";
                LoadData();
            }
        }
Beispiel #18
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            if (updateID == "")
            {
                return;
            }
            if (MessageBox.Show("YES or No?", "Are you sure you want to update this information? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                _category = new Category(updateID, titleTxt.Text, docTxt.Text, hosTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), Helper.orgID);

                DBConnect.Update(_category, updateID);
                Global._categories.RemoveAll(x => x.Id == updateID);
                Global._categories.Add(_category);
                // DBConnect.Execute(SQL);
                MessageBox.Show("Information updated");
                saveBtn.Visible   = true;
                updateBtn.Visible = false;
                updateID          = "";
                titleTxt.Text     = "";
                docTxt.Text       = "";
                hosTxt.Text       = "";
                LoadData();
            }
        }
Beispiel #19
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 = "";
        }
Beispiel #20
0
        private void dtGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            updateID = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString();


            if (e.ColumnIndex == 11)
            {
                if (dtGrid.Rows[e.RowIndex].Cells["Paid for consulation"].Value.ToString() != "Yes")
                {
                    if (MessageBox.Show("YES or No?", "Payments not yet made would you like to continue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                    {
                    }
                    else
                    {
                        return;
                    }
                }
                if (MessageBox.Show("YES or No?", "Is visit complete? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    //Global._queues.RemoveAll(x => x.Id == updateID);
                    //DBConnect.Delete("queue", dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString());
                    _queue = new Queue(updateID, _queues.First(x => x.Id.Contains(updateID)).Follow, _queues.First(x => x.Id.Contains(updateID)).PatientID, _queues.First(x => x.Id.Contains(updateID)).UserID, _queues.First(x => x.Id.Contains(updateID)).RoomID, _queues.First(x => x.Id.Contains(updateID)).ClinicID, "Complete", _queues.First(x => x.Id.Contains(updateID)).Dated, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), _queues.First(x => x.Id.Contains(updateID)).Department, "", "", "", "", "", "", "", "", "", Helper.orgID, dtGrid.Rows[e.RowIndex].Cells["type"].Value.ToString());

                    DBConnect.Update(_queue, updateID);
                    Global._queues.RemoveAll(x => x.Id == updateID);
                    Global._queues.Add(_queue);
                    MessageBox.Show("Information updated");
                    LoadData();
                }
            }

            if (e.ColumnIndex == 10)
            {
                if (dtGrid.Rows[e.RowIndex].Cells["Paid for consulation"].Value.ToString() != "Yes")
                {
                    if (MessageBox.Show("YES or No?", "Payments not yet made would you like to continue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                    {
                    }
                    else
                    {
                        return;
                    }
                }

                string visitID        = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString();
                string patientID      = dtGrid.Rows[e.RowIndex].Cells["patientID"].Value.ToString();
                string practitionerID = dtGrid.Rows[e.RowIndex].Cells["practitionerID"].Value.ToString();
                string department     = dtGrid.Rows[e.RowIndex].Cells["Department"].Value.ToString();
                if (department.Contains("ent"))
                {
                    DentalForm frm = new DentalForm(visitID, patientID, practitionerID);
                    frm.MdiParent = MainForm.ActiveForm;
                    frm.Dock      = DockStyle.Fill;
                    frm.Show();
                }
                else
                {
                    PatientVisit frm = new PatientVisit(visitID, patientID, practitionerID);
                    frm.MdiParent = MainForm.ActiveForm;
                    frm.Dock      = DockStyle.Fill;
                    frm.Show();
                }
            }
            if (e.ColumnIndex == 16)
            {
                if (dtGrid.Rows[e.RowIndex].Cells["Paid for consulation"].Value.ToString() != "Yes")
                {
                    if (MessageBox.Show("YES or No?", "Payments not yet made would you like to continue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                    {
                    }
                    else
                    {
                        return;
                    }
                }
                string visitID        = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString();
                string patientID      = dtGrid.Rows[e.RowIndex].Cells["patientID"].Value.ToString();
                string practitionerID = dtGrid.Rows[e.RowIndex].Cells["practitionerID"].Value.ToString();


                OutPatient frm = new OutPatient(visitID, patientID, practitionerID);
                frm.MdiParent = MainForm.ActiveForm;
                frm.Dock      = DockStyle.Fill;
                frm.Show();
            }
            if (e.ColumnIndex == dtGrid.Columns["Remove"].Index && e.RowIndex >= 0)
            {
                if (MessageBox.Show("YES or No?", "Remove Patient from Queue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    DBConnect.Delete("queue", dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString());
                    Global._queues.RemoveAll(w => w.Id.Contains(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString()));
                    MessageBox.Show("Information deleted");
                    LoadData();
                    LoadItem();
                }
            }
        }