Пример #1
0
    private void BindRepater()
    {
        //Bind Prescription Session Repeater
        List <PrescriptionSessionData> prscSessionData = PrescriptionSessionDataBLL.GetList();

        repeatSessions.DataSource = prscSessionData;
        repeatSessions.DataBind();

        List <PrescriptionSession> prscSessions =
            PrescriptionSessionBLL.GetListByPrescription(prescription.PrescriptionId);

        foreach (RepeaterItem item in repeatSessions.Items)
        {
            TextBox  txtCounter     = (TextBox)item.FindControl("txtCounter");
            TextBox  txtComment     = (TextBox)item.FindControl("txtComment");
            CheckBox chkCourse      = (CheckBox)item.FindControl("chkCourse");
            TextBox  txtSessionName = (TextBox)item.FindControl("txtSessionName");

            foreach (var prsc in prscSessions)
            {
                if (prsc.SessionName == txtSessionName.Text)
                {
                    txtCounter.Text   = prsc.Number.ToString();
                    txtComment.Text   = prsc.Comment;
                    chkCourse.Checked = true;
                }
            }
        }
    }
Пример #2
0
    protected void btnSave_OnClick(object sender, EventArgs e)
    {
        PrescriptionSessionData prscSessionData = new PrescriptionSessionData();

        prscSessionData.SessionDataName = txtData.Text;
        PrescriptionSessionDataBLL.Insert(prscSessionData);
        txtData.Text = "";
        BindGrid();
    }
Пример #3
0
    protected void btnUpdate_OnClick(object sender, EventArgs e)
    {
        PrescriptionSessionData prscSessionData = new PrescriptionSessionData();

        prscSessionData.SessionDataId   = Convert.ToInt16(Application["id"]);
        prscSessionData.SessionDataName = txtData.Text;
        PrescriptionSessionDataBLL.update(prscSessionData);
        txtData.Text      = "";
        btnSave.Visible   = true;
        btnUpdate.Visible = false;
        BindGrid();
    }
Пример #4
0
 private void BindGrid()
 {
     try
     {
         List <PrescriptionSessionData> ds = PrescriptionSessionDataBLL.GetList();
         grd.DataSource = ds; //clntBLL.GetAllClients();
         grd.DataBind();
     }
     catch (Exception ex)
     {
         grd.EmptyDataText = ex.Message;
         grd.DataBind();
     }
 }
Пример #5
0
    private void BindRepater()
    {
        try
        {
            List <SessionQuestionData> questions = SessionQuestionDataBLL.GetList();
            questionRepeater.DataSource = questions;
            questionRepeater.DataBind();

            //Bind Prescription Session Repeater
            List <PrescriptionSessionData> prscSessionData = PrescriptionSessionDataBLL.GetList();
            repeatSessions.DataSource = prscSessionData;
            repeatSessions.DataBind();
        }
        catch (Exception)
        {
            this.ShowHelperMessage("Warning", "Please Fill Questions table or Sessions table first", HelperNotify.NotificationType.error);
        }
    }
Пример #6
0
    protected void grd_OnRowCommand(object sender, GridViewCommandEventArgs e)
    {
        int id;

        if (e.CommandName == "EditCommand")
        {
            id = Convert.ToInt32(e.CommandArgument);
            PrescriptionSessionData prsSessionData = PrescriptionSessionDataBLL.GetItem(id);
            txtData.Text      = prsSessionData.SessionDataName;
            btnSave.Visible   = false;
            btnUpdate.Visible = true;
            Application["id"] = id;
        }
        else if (e.CommandName == "DeleteCommand")
        {
            id = Convert.ToInt32(e.CommandArgument);
            PrescriptionSessionData prsSessionData = PrescriptionSessionDataBLL.GetItem(id);
            PrescriptionSessionDataBLL.Delete(prsSessionData);
            BindGrid();
        }
    }