Exemple #1
0
        private void initConfig()
        {
            theme1.Theme           = bc.iniC.themeApplication;
            txtUserName.KeyUp     += TxtUserName_KeyUp;
            txtUserName.LostFocus += TxtUserName_LostFocus;
            txtUserName.Enter     += TxtUserName_Enter;
            txtPassword.KeyUp     += TxtPassword_KeyUp;
            txtPassword.Enter     += TxtUserName_Enter;
            btnOk.Click           += BtnOk_Click;
            bg = txtUserName.BackColor;
            fc = txtUserName.ForeColor;

            //theme1.SetTheme(panel1, "Office2013Red");
            theme1.SetTheme(btnOk, bc.iniC.themeApplication);
            stt   = new C1SuperTooltip();
            sep   = new C1SuperErrorProvider();
            stfDB = new StaffDB(bc.conn);
            foreach (Control con in panel1.Controls)
            {
                theme1.SetTheme(con, bc.iniC.themeApplication);
            }
            theme1.SetTheme(txtUserName, bc.iniC.themeDonor);
            theme1.SetTheme(txtPassword, bc.iniC.themeDonor);
            //stt.BackgroundGradient = C1.Win.C1SuperTooltip.BackgroundGradient.Gold;
            //stt.
        }
    protected void UpdateList()
    {
        Staff        staff = IsValidFormStaffID() ? StaffDB.GetByID(GetFormStaffID()) : null;
        Organisation org   = IsValidFormOrgID()   ? OrganisationDB.GetByID(GetFormOrgID()) : null;

        UpdateList(org, staff);
    }
 // gets messages regarding dispute selected
 protected string retrieveMessage(string memberID, string staffID, string reply, string datePosted)
 {
     if (memberID != "")
     {
         return(" <div class='item'> \n " +
                " <div class='text'> \n " +
                " <div class='heading'> \n " +
                " <a class='text-success' href='#'>" + MemberDB.getMemberbyID(memberID).Name + "</a> \n " +
                " <span class='date'>" + Convert.ToString(datePosted) + "</span> \n " +
                " </div> \n " +
                reply +
                " </div> \n " +
                " </div> \n ");
     }
     else
     {
         return(" <div class='item'> \n " +
                " <div class='text'> \n " +
                " <div class='heading'> \n " +
                " <a href='#'> <Strong> (Staff) " + StaffDB.getStaffbyID(staffID).Name + " </strong> </a> \n " +
                " <span class='date'>" + Convert.ToString(datePosted) + "</span> \n " +
                " </div> \n " +
                reply +
                " </div> \n " +
                " </div> \n ");
     }
 }
Exemple #4
0
        private void DeleteStaff()
        {
            try
            {
                //If button is clicked, a messagebox will be shown to make sure that the user wants to delete the patient
                MessageBoxResult result = MessageBox.Show("Are you sure you want to delete the patient?", "Delete", MessageBoxButton.YesNoCancel, MessageBoxImage.Exclamation, MessageBoxResult.No);

                if (result == MessageBoxResult.Yes)
                {
                    rowsAffected = StaffDB.deleteStaff(SelectedStaff);

                    Staff.Clear();
                    DisplayAllStaff();

                    if (rowsAffected != 0)
                    {
                        MessageBox.Show("Staff Deleted");
                    }
                    else
                    {
                        MessageBox.Show("Delete Failed");
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
 //populate listbox with staff
 private void initcombo()
 {
     stafflist.Items.Clear();
     StaffDB staffdb = new StaffDB(db);
     staff = staffdb.getallstaff();
     if(staff.Count == 0) // no staff added
     {
         btnadd.Visible = false;
         btnremove.Visible = false;
         mode = "add";
         enableTextboxes();
     }
     else
     {
         if (!stilladding && (!btnadd.Visible || !btnremove.Visible && staff.Count > 0))
         {
             btnadd.Visible = true;
             btnremove.Visible = true;
         }
         foreach (StaffMember member in staff)
         {
             stafflist.Items.Add(member.Forename + " " + member.Surname);
         }
         stafflist.SelectedIndex = 0;
     }
 }
        private void stafflist_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!stilladding) // still adding no update needed
            {
                StaffDB sdb = new StaffDB(db);
                staffGroup = sdb.getStaffGroup(staff[stafflist.SelectedIndex].Forename);
                foreach (StaffMember member in staff)
                {
                    if (member.Forename + " " + member.Surname == stafflist.Text)
                    {
                        current = member;
                        break;
                    }
                }

                mode = "edit1";
                fnametxt.Text = current.Forename;
                Surnametxt.Text = current.Surname;
                TeleNotxt.Text = current.TeleNo;
                Addresstxt.Text = current.Address;
                Postcodetxt.Text = current.Postcode;
                groupcbx.SelectedIndex = staffGroup - 1;
                btnupdate.Text = "Edit";
            }
        }
Exemple #7
0
    protected void GrdRegistration_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Label        lblId             = (Label)GrdRegistration.Rows[e.RowIndex].FindControl("lblId");
        DropDownList ddlOrganisation   = (DropDownList)GrdRegistration.Rows[e.RowIndex].FindControl("ddlOrganisation");
        TextBox      txtProviderNumber = (TextBox)GrdRegistration.Rows[e.RowIndex].FindControl("txtProviderNumber");
        CheckBox     chkMainProvider   = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkMainProvider");
        CheckBox     chkIncMondays     = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkIncMondays");
        CheckBox     chkIncTuesdays    = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkIncTuesdays");
        CheckBox     chkIncWednesdays  = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkIncWednesdays");
        CheckBox     chkIncThursdays   = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkIncThursdays");
        CheckBox     chkIncFridays     = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkIncFridays");
        CheckBox     chkIncSaturdays   = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkIncSaturdays");
        CheckBox     chkIncSundays     = (CheckBox)GrdRegistration.Rows[e.RowIndex].FindControl("chkIncSundays");


        Staff staff = StaffDB.GetByID(GetFormID());

        if (staff == null)
        {
            HideTableAndSetErrorMessage("");
            return;
        }

        RegisterStaffDB.Update(Convert.ToInt32(lblId.Text), Convert.ToInt32(ddlOrganisation.SelectedValue), staff.StaffID, txtProviderNumber.Text, chkMainProvider.Checked,
                               !chkIncSundays.Checked, !chkIncMondays.Checked, !chkIncTuesdays.Checked, !chkIncWednesdays.Checked, !chkIncThursdays.Checked, !chkIncFridays.Checked, !chkIncSaturdays.Checked);
        if (chkMainProvider.Checked)
        {
            RegisterStaffDB.UpdateAllOtherStaffAsNotMainProviders(Convert.ToInt32(ddlOrganisation.SelectedValue), staff.StaffID);
        }

        GrdRegistration.EditIndex = -1;
        FillGrid();
    }
 // gets messages regarding supoprt ticket selected
 protected string retrieveMessage(string memberID, string staffID, string reply, string datePosted)
 {
     if (MemberDB.getMemberbyID(memberID).Email == SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"].ToString()).Member.Email)
     {
         return(" <div class='item'> \n " +
                " <div class='text'> \n " +
                " <div class='heading'> \n " +
                " <a class='text-success' href='#'>" + MemberDB.getMemberbyID(memberID).Name + "</a> \n " +
                " <span class='date'>" + Convert.ToString(datePosted) + "</span> \n " +
                " </div> \n " +
                reply +
                " </div> \n " +
                " </div> \n ");
     }
     else
     {
         return(" <div class='item'> \n " +
                " <div class='text'> \n " +
                " <div class='heading'> \n " +
                " <a href='#'> <Strong> (Staff) " + StaffDB.getStaffbyID(staffID).Name + " </strong> </a> \n " +
                " <span class='date'>" + Convert.ToString(datePosted) + "</span> \n " +
                " </div> \n " +
                reply +
                " </div> \n " +
                " </div> \n ");
     }
 }
Exemple #9
0
    protected void SetUpGUI()
    {
        ddlNewStaff.Items.Clear();
        ddlNewStaff.Items.Add(new ListItem("All Staff", "-1"));
        DataTable dtStaff = StaffDB.GetDataTable();

        for (int i = 0; i < dtStaff.Rows.Count; i++)
        {
            if (!Convert.ToBoolean(dtStaff.Rows[i]["staff_is_fired"]) && Convert.ToBoolean(dtStaff.Rows[i]["staff_is_provider"]))
            {
                ddlNewStaff.Items.Add(new ListItem(dtStaff.Rows[i]["person_firstname"].ToString() + " " + dtStaff.Rows[i]["person_surname"].ToString(), dtStaff.Rows[i]["staff_staff_id"].ToString()));
            }
        }

        ddlNewOffering.Style["max-width"] = "250px";
        ddlNewOffering.Items.Clear();
        ddlNewOffering.Items.Add(new ListItem("All Offerings", "-1"));
        DataTable dtOfferings = OfferingDB.GetDataTable(false, "1,3", "63,89");

        for (int i = 0; i < dtOfferings.Rows.Count; i++)
        {
            if (!Convert.ToBoolean(dtOfferings.Rows[i]["o_is_deleted"]))
            {
                ddlNewOffering.Items.Add(new ListItem(dtOfferings.Rows[i]["o_name"].ToString(), dtOfferings.Rows[i]["o_offering_id"].ToString()));
            }
        }

        txtNewActiveDate.Text = DateTime.Today.ToString("dd-MM-yyyy");
    }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Utilities.SetNoCache(Response);
        }

        try
        {
            if (Session == null || Session["DB"] == null)
            {
                throw new SessionTimedOutException();
            }

            string show = Request.QueryString["show"];
            if (show == null || (show != "1" && show != "0"))
            {
                throw new CustomMessageException();
            }

            int staffID = Convert.ToInt32(Session["StaffID"]);

            StaffDB.UpdateBookingScreenShowKey(staffID, show == "1");
        }
        catch (SessionTimedOutException)
        {
            Utilities.UnsetSessionVariables();
            Response.Write("SessionTimedOutException");
        }
        catch (Exception ex)
        {
            Response.Write("Exception: " + (Utilities.IsDev() ? ex.ToString() : "please contact system administrator."));
        }
    }
        public static Staffs.Staffs InsertStaff(object json, List <Staffs.Staffs> StaffList)
        {
            dynamic dynamicstaff = JsonConvert.DeserializeObject(json.ToString());

            Staffs.Staffs staff  = new Staffs.Staffs();
            int           typeno = (int)dynamicstaff.staffType;

            switch (typeno)
            {
            case 1:
                staff    = JsonConvert.DeserializeObject <TeachingStaffs>(json.ToString());
                staff.Id = StaffDB.GetId();
                return(staff);

            case 2:
                staff    = JsonConvert.DeserializeObject <AdministrativeStaff>(json.ToString());
                staff.Id = StaffDB.GetId();
                return(staff);

            case 3:
                staff    = JsonConvert.DeserializeObject <SupportStaffs>(json.ToString());
                staff.Id = StaffDB.GetId();
                return(staff);

            default:
                return(staff);
            }
        }
Exemple #12
0
        //populate the group stats for the user
        private void populategroupNums()
        {
            GroupDB       gdb        = new GroupDB(db);
            List <int>    groupNums  = gdb.numineachgroup();
            List <string> groupNames = gdb.getgroupnames(); // use the correct group names set by the user

            GroupANum.Text = groupNames[0] + " : ";
            GroupBNum.Text = groupNames[1] + " : ";
            GroupCNum.Text = groupNames[2] + " : ";

            num1.Text = groupNums[0].ToString();
            Num2.Text = groupNums[1].ToString();
            Num3.Text = groupNums[2].ToString();

            if (groupNums[0] >= gdb.getANum())
            {
                num1.ForeColor = Color.Red;
            }
            else
            {
                num1.ForeColor = Color.LimeGreen;
            }
            if (groupNums[1] >= gdb.getBNum())
            {
                Num2.ForeColor = Color.Red;
            }
            else
            {
                Num2.ForeColor = Color.LimeGreen;
            }

            if (groupNums[2] >= gdb.getCNum())
            {
                Num3.ForeColor = Color.Red;
            }
            else
            {
                Num3.ForeColor = Color.LimeGreen;
            }
            StaffDB sdb = new StaffDB(db);

            StaffA.Text = groupNames[0] + " : " + sdb.countStaffbyid(1);
            StaffB.Text = groupNames[1] + " : " + sdb.countStaffbyid(2);
            StaffC.Text = groupNames[2] + " : " + sdb.countStaffbyid(3);
            List <Label> stafflabels = new List <Label>()
            {
                StaffA, StaffB, StaffC
            };
            int counter = 0;

            foreach (Label label in stafflabels)
            {
                counter++;
                if (sdb.countStaffbyid(counter) < 2)
                {
                    label.ForeColor = Color.Red;
                }
            }
        }
Exemple #13
0
 // method to read the column values in the database (through the referenced reader) and assign it to the correct properties of the referenced FAQ object
 // allows for easier editing of column names if needed, used only for methods with select statments regarding FAQ
 private static void readAFAQ(ref FAQ faq, ref SqlDataReader reader)
 {
     faq.FaqID       = reader["faqID"].ToString();
     faq.Title       = reader["title"].ToString();
     faq.Description = reader["description"].ToString();
     faq.Date        = Convert.ToDateTime(reader["date"]);
     faq.Staff       = StaffDB.getStaffbyID(reader["staffID"].ToString());
 }
Exemple #14
0
    protected void lnkBackToCallCenter_Click(object sender, EventArgs e)
    {
        if (Session == null || Session["PreviousDB"] == null)
        {
            Utilities.LogoutV2(Session, Response, Request);
            return;
        }

        Session["DB"] = (string)Session["PreviousDB"];
        Session["SystemVariables"] = SystemVariableDB.GetAll();

        // Set system staff variables of external staff member 'Call Center'
        Staff staff = StaffDB.GetByID(Convert.ToInt32(Session["PreviousStaffID"]));

        Session["IsLoggedIn"]    = true;
        Session["IsStakeholder"] = staff.IsStakeholder;
        Session["IsMasterAdmin"] = staff.IsMasterAdmin;
        Session["IsAdmin"]       = staff.IsAdmin;
        Session["IsPrincipal"]   = staff.IsPrincipal;
        Session["IsProvider"]    = staff.IsProvider;
        Session["IsExternal"]    = staff.IsExternal;
        Session["StaffID"]       = staff.StaffID;
        Session["StaffFullnameWithoutMiddlename"] = staff.Person.FullnameWithoutMiddlename;
        Session["StaffFirstname"] = staff.Person.Firstname;

        Site site = SiteDB.GetByID(Convert.ToInt32(Session["PreviousSiteID"]));

        Session["SiteID"]         = site.SiteID;
        Session["SiteName"]       = site.Name;
        Session["SiteIsClinic"]   = site.SiteType.ID == 1;
        Session["SiteIsAgedCare"] = site.SiteType.ID == 2;
        Session["SiteIsGP"]       = site.SiteType.ID == 3;
        Session["SiteTypeID"]     = site.SiteType.ID;
        Session["SiteTypeDescr"]  = site.SiteType.Descr;

        Session["IsMultipleSites"] = SiteDB.GetAll().Length > 1;



        Session.Remove("PreviousDB");
        Session.Remove("PreviousStaffID");
        Session.Remove("PreviousSiteID");


        // Set OrgID in session as external user has OrgID set
        Session.Remove("OrgID");
        Session.Remove("OrgName");

        // Remove patient list session data for pt searches
        Session.Remove("patientinfo_data");
        Session.Remove("patientlist_data");
        Session.Remove("patientlist_sortexpression");
        Session.Remove("patientinfo_sortexpression");

        // Go to call center page
        Response.Redirect("~/CallCenterV2.aspx", false);
        return;
    }
Exemple #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // checks if user-entered credentials exists in database
     if (StaffDB.isPermittedLogin(tbxEmail.Value, tbxPassword.Value)) // if exists in database, redirect to default page
     {
         Session["admin"] = tbxEmail.Value;
         Response.Redirect("Default.aspx");
     }
 }
Exemple #16
0
        //Method to displayAllStaff
        public void DisplayAllStaff()
        {
            var allStaff = StaffDB.GetAllStaff();

            foreach (var item in allStaff)
            {
                Staff.Add(item);
            }
        }
    public static ReferrerAdditionalEmail LoadAll(DataRow row)
    {
        ReferrerAdditionalEmail rae = Load(row);

        rae.DeletedBy              = StaffDB.Load(row, "deleted_by_");
        rae.DeletedBy.Person       = PersonDB.Load(row, "person_deleted_by_");
        rae.DeletedBy.Person.Title = IDandDescrDB.Load(row, "title_deleted_by_title_id", "title_deleted_by_descr");

        return(rae);
    }
Exemple #18
0
    protected void SetProviderNbrs()
    {
        string provs = StaffDB.GetAllProviderNbrs() + RegisterStaffDB.GetAllProviderNbrs();

        if (provs.Length > 0)
        {
            provs = provs.Substring(0, provs.Length - 1);
        }
        lblProvNbrs.Text = provs;
    }
Exemple #19
0
        //Method to call the searchpatient instance from the PatientDB.
        //This method will be attached to the button 'Search' command.
        private void SearchStaff()
        {
            Staff.Clear();
            var search = StaffDB.SearchStaff(SearchInput);

            foreach (var item in search)
            {
                Staff.Add(item);
            }
        }
Exemple #20
0
    public static CreditNote LoadAll(DataRow row)
    {
        CreditNote creditNote = Load(row);

        creditNote.Staff              = StaffDB.Load(row, "staff_");
        creditNote.Staff.Person       = PersonDB.Load(row, "person_");
        creditNote.Staff.Person.Title = IDandDescrDB.Load(row, "title_title_id", "title_descr");

        return(creditNote);
    }
Exemple #21
0
    protected void SetupGUI()
    {
        bool isValidFormPatient = IsValidFormPatient();

        if (isValidFormPatient)
        {
            Patient patient = PatientDB.GetByID(GetFormPatient());
            lblSelectedPatientName.Text = "<a href=\"#\" onclick=\"open_new_window('PatientDetailV2.aspx?type=view&id=" + patient.PatientID + "', 1750, 1000);return false;\">" + patient.Person.FullnameWithoutMiddlename + "</a>";
        }

        lblSelectedPatientLabelText.Visible = isValidFormPatient;
        lblSelectedPatientName.Visible      = isValidFormPatient;
        btnClearSelectedPatient.Visible     = isValidFormPatient;



        txtStartDate.Text = GetFormDate().ToString("dd-MM-yyyy");

        for (int i = 1; i <= 8; i++)
        {
            ddlDaysToDisplay.Items.Add(new ListItem(i.ToString(), i.ToString()));
        }

        int ndays = GetFormNumDays();

        if (ndays < 1)
        {
            ndays = 1;
        }
        if (ndays > 8)
        {
            ndays = 8;
        }
        ddlDaysToDisplay.SelectedValue = ndays.ToString();

        if (Convert.ToInt32(ddlDaysToDisplay.SelectedValue) != Convert.ToInt32(Session["NumDaysToDisplayOnBookingScreen"]))
        {
            StaffDB.UpdateNumDaysToDisplayOnBookingScreen(Convert.ToInt32(Session["StaffID"]), Convert.ToInt32(ddlDaysToDisplay.SelectedValue));
            Session["NumDaysToDisplayOnBookingScreen"] = Convert.ToInt32(ddlDaysToDisplay.SelectedValue);
        }

        if (UserView.GetInstance().IsAgedCareView)
        {
            lblGetPatientLabelText.Visible = false;
            txtSearchFullName.Visible      = false;
            btnClearFullNameSearch.Visible = false;

            lblSelectedPatientLabelText.Visible = false;
            lblSelectedPatientName.Visible      = false;
            btnClearSelectedPatient.Visible     = false;

            pt_table_seperator.Style["min-width"] = "0px";
        }
    }
Exemple #22
0
    public static PatientHistory LoadAll(DataRow row)
    {
        PatientHistory p = Load(row);

        p.Title = IDandDescrDB.Load(row, "title_id", "descr");

        p.ModifiedFromThisBy              = StaffDB.Load(row, "staff_person_");
        p.ModifiedFromThisBy.Person       = PersonDB.Load(row, "staff_person_");
        p.ModifiedFromThisBy.Person.Title = IDandDescrDB.Load(row, "title_staff_title_id", "title_staff_descr");

        return(p);
    }
Exemple #23
0
    public static Refund LoadAll(DataRow row)
    {
        Refund refund = Load(row);

        refund.RefundReason = IDandDescrDB.Load(row, "refund_reason_id", "descr");

        refund.Staff              = StaffDB.Load(row, "staff_");
        refund.Staff.Person       = PersonDB.Load(row, "staff_person_");
        refund.Staff.Person.Title = IDandDescrDB.Load(row, "title_title_id", "title_descr");

        return(refund);
    }
    // method to get MessageSupportTicket by suport ticket from the database
    public static List <TicketMsg> getMessage1(SupportTicket t)
    {
        List <TicketMsg> msgList = new List <TicketMsg>();

        try
        {
            SqlCommand command = new SqlCommand("select * from MessageSupportTicket where ticketID = @ticketID ");
            command.Parameters.AddWithValue("@ticketID", t.TicketID);
            command.Connection = connection;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader();


            while (reader.Read())
            {
                TicketMsg tix = new TicketMsg();
                if (reader.IsDBNull(2)) //member null
                {
                    tix.Date   = Convert.ToDateTime(reader["date"]);
                    tix.Msg    = reader["reply"].ToString();
                    tix.Ticket = t;
                    Staff s = StaffDB.getStaffbyID(reader["staffID"].ToString());
                    tix.Person = s.Name;
                    msgList.Add(tix);
                }
                if (reader.IsDBNull(3)) //stuff null
                {
                    tix.Date   = Convert.ToDateTime(reader["date"]);
                    tix.Msg    = reader["reply"].ToString();
                    tix.Ticket = t;
                    Member m = MemberDB.getMemberbyID(reader["memberID"].ToString());
                    tix.Person = m.Name;
                    msgList.Add(tix);
                }
            }
            if (!reader.HasRows)
            {
                TicketMsg tix = new TicketMsg();
                tix.Date   = Convert.ToDateTime("1/1/0001 00:00:00");
                tix.Msg    = "No Messages Yet";
                tix.Person = "System";
                tix.Ticket = t;
                msgList.Add(tix);
            }

            //reader.Close();
        }
        finally
        {
            connection.Close();
        }
        return(msgList);
    }
    public static HealthCardEPCRemainingChangeHistory[] GetByHealthCardID(int health_card_id)
    {
        string sql = @"
            SELECT  
                    health_card_epc_remaining_change_history_id,HealthCardEPCRemainingChangeHistory.health_card_epc_remaining_id,HealthCardEPCRemainingChangeHistory.staff_id,date,
                    pre_num_services_remaining,post_num_services_remaining,
                    health_card_id,HealthCardEPCRemaining.field_id,num_services_remaining,deleted_by,date_deleted,
                    Field.descr,

                    staff.staff_id as staff_staff_id, staff.person_id as staff_person_id, staff.login as staff_login, staff.pwd as staff_pwd, 
                    staff.staff_position_id as staff_staff_position_id, staff.field_id as staff_field_id, staff.costcentre_id as staff_costcentre_id, 
                    staff.is_contractor as staff_is_contractor, staff.tfn as staff_tfn, staff.provider_number as staff_provider_number, 
                    staff.is_fired as staff_is_fired, staff.is_commission as staff_is_commission, staff.commission_percent as staff_commission_percent, 
                    staff.is_stakeholder as staff_is_stakeholder,staff.is_master_admin as staff_is_master_admin,staff.is_admin as staff_is_admin,staff.is_principal as staff_is_principal,staff.is_provider as staff_is_provider, staff.is_external as staff_is_external,
                    staff.staff_date_added as staff_staff_date_added, staff.start_date as staff_start_date, staff.end_date as staff_end_date, 
                    staff.comment as staff_comment, 
                    staff.num_days_to_display_on_booking_screen as staff_num_days_to_display_on_booking_screen,
                    staff.show_header_on_booking_screen as staff_show_header_on_booking_screen,
                    staff.bk_screen_field_id as staff_bk_screen_field_id, staff.bk_screen_show_key as staff_bk_screen_show_key,
                    staff.enable_daily_reminder_sms as staff_enable_daily_reminder_sms, 
                    staff.enable_daily_reminder_email as staff_enable_daily_reminder_email,
                    staff.hide_booking_notes as staff_hide_booking_notes,

                    " + PersonDB.GetFields("person_", "person") + @",
                    title.title_id as title_title_id, title.descr as title_descr

            FROM    
                    HealthCardEPCRemainingChangeHistory 
                    LEFT OUTER JOIN HealthCardEPCRemaining ON HealthCardEPCRemainingChangeHistory.health_card_epc_remaining_id  = HealthCardEPCRemaining.health_card_epc_remaining_id
                    LEFT OUTER JOIN Field                  ON HealthCardEPCRemaining.field_id = Field.field_id

                    LEFT OUTER JOIN Staff  staff   ON staff.staff_id   = HealthCardEPCRemainingChangeHistory.staff_id
                    LEFT OUTER JOIN Person person  ON person.person_id = staff.person_id
                    LEFT OUTER JOIN Title  title   ON title.title_id   = person.title_id

            WHERE   
                    HealthCardEPCRemaining.health_card_id = " + health_card_id;

        DataTable tbl = DBBase.ExecuteQuery(sql).Tables[0];

        HealthCardEPCRemainingChangeHistory[] histories = new HealthCardEPCRemainingChangeHistory[tbl.Rows.Count];
        for (int i = 0; i < tbl.Rows.Count; i++)
        {
            histories[i] = Load(tbl.Rows[i]);
            histories[i].HealthCardEpcRemaining       = HealthCardEPCRemainingDB.Load(tbl.Rows[i]);
            histories[i].HealthCardEpcRemaining.Field = IDandDescrDB.Load(tbl.Rows[i], "field_id", "descr");

            histories[i].Staff              = StaffDB.Load(tbl.Rows[i], "staff_");
            histories[i].Staff.Person       = PersonDB.Load(tbl.Rows[i], "person_");
            histories[i].Staff.Person.Title = IDandDescrDB.Load(tbl.Rows[i], "title_title_id", "title_descr");
        }
        return(histories);
    }
    // posts message and updates database of the message posted
    private void submitMessage(string message, Dispute dis)
    {
        MessageDispute msgDis = new MessageDispute();

        msgDis.Date    = DateTime.Now;
        msgDis.Dispute = dis;
        msgDis.Member  = new Member(null, null, null, 0, null, null, 0, null, null, new DateTime(), new DateTime(), null, new DateTime(), null, null);
        msgDis.Staff   = StaffDB.getStaffbyEmail(Session["admin"].ToString());

        msgDis.Reply = message;
        MessageDisputeDB.addMsgDispute(msgDis);
    }
Exemple #27
0
 //remove staff member/bookings
 private void btnremove_Click(object sender, EventArgs e)
 {
     MessageBox.Show("WARNING removing staff members can affect bookings");
     DialogResult dialogResult = MessageBox.Show("Are you sure you want to Remove this staff member?", "Removal", MessageBoxButtons.YesNo);
     if (dialogResult == DialogResult.Yes)
     {
         removeBookings();
         StaffDB staffdb = new StaffDB(db);
         staffdb.removeStaffmember(staff[stafflist.SelectedIndex].Forename); // remove staff member
         initcombo();
     }
 }
Exemple #28
0
        //remove bookings if required
        private void removeBookings()
        {
            StaffDB staffdb = new StaffDB(db);
            int count = staffdb.countStaff(staff[stafflist.SelectedIndex].Forename);

            if (count <= 2) // if there will be less than two staff remove the bookings
            {
                int deleted = staffdb.DeleteDates(staff[stafflist.SelectedIndex].Forename);
                MessageBox.Show($"{deleted} Bookings temporarly removed due to the removal of the staff member, add another staff member to get these bookings back, check by-date to view bookings removed");
            }

        }
Exemple #29
0
    public static Receipt LoadAll(DataRow row)
    {
        Receipt receipt = Load(row);

        receipt.Staff              = StaffDB.Load(row, "staff_");
        receipt.Staff.Person       = PersonDB.Load(row, "person_");
        receipt.Staff.Person.Title = IDandDescrDB.Load(row, "title_title_id", "title_descr");

        receipt.ReceiptPaymentType = IDandDescrDB.Load(row, "receipt_payment_type_id", "descr");

        return(receipt);
    }
Exemple #30
0
    public static Staff[] GetWorkingStaffOf(int organistion_id, DateTime date)
    {
        DataTable tbl = GetDataTable_WorkingStaffOf(organistion_id, date);

        Staff[] list = new Staff[tbl.Rows.Count];
        for (int i = 0; i < tbl.Rows.Count; i++)
        {
            list[i]              = StaffDB.Load(tbl.Rows[i]);
            list[i].Person       = PersonDB.Load(tbl.Rows[i], "", "person_entity_id");
            list[i].Person.Title = IDandDescrDB.Load(tbl.Rows[i], "title_id", "descr");
        }
        return(list);
    }