protected void BtnNewOrderClick(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "loadpharm", "parent.ShowLoading()", true);
            Session["IsFirstLoad"] = "true";
            Page        mp  = (Page)this.Parent.Page;
            PlaceHolder ph  = (PlaceHolder)mp.FindControl("phForms");
            UpdatePanel upt = (UpdatePanel)mp.FindControl("updtForms");

            Session["CurrentFormName"] = "frmLabOrderTouch";

            Touch.Custom_Forms.frmLabOrderTouch fr = (frmLabOrderTouch)mp.LoadControl("frmLabOrderTouch.ascx");

            fr.ID = "ID" + Session["CurrentFormName"].ToString();
            frmLabOrderTouch theFrm = (frmLabOrderTouch)ph.FindControl("ID" + Session["CurrentFormName"].ToString());

            foreach (Control item in ph.Controls)
            {
                ph.Controls.Remove(item);
                //item.Visible = false;
            }

            if (theFrm != null)
            {
                theFrm.Visible = true;
            }
            else
            {
                ph.Controls.Add(fr);
            }
            ph.DataBind();
            upt.Update();
            mp.ClientScript.RegisterStartupScript(mp.GetType(), "settabschild", "setTabs();");
        }
Esempio n. 2
0
        protected void LabSummaryPage()
        {
            Session["IsFirstLoad"] = "true";
            Page        mp  = (Page)this.Parent.Page;
            PlaceHolder ph  = (PlaceHolder)mp.FindControl("phForms");
            UpdatePanel upt = (UpdatePanel)mp.FindControl("updtForms");

            Session["CurrentFormName"] = "frmLaboratoryTouch";

            Touch.Custom_Forms.frmLaboratoryTouch fr = (frmLaboratoryTouch)mp.LoadControl("~/Touch/Custom Forms/frmLaboratoryTouch.ascx");

            fr.ID = "ID" + Session["CurrentFormName"].ToString();
            frmLaboratoryTouch theFrm = (frmLaboratoryTouch)ph.FindControl("ID" + Session["CurrentFormName"].ToString());

            foreach (Control item in ph.Controls)
            {
                ph.Controls.Remove(item);
                //item.Visible = false;
            }

            if (theFrm != null)
            {
                theFrm.Visible = true;
            }
            else
            {
                ph.Controls.Add(fr);
            }
            ph.DataBind();
            upt.Update();
            mp.ClientScript.RegisterStartupScript(mp.GetType(), "settabschild", "setTabs();");
        }
Esempio n. 3
0
    protected void ShowRegion(PlaceHolder region)
    {
        Controls.OfType <PlaceHolder>().ToList().ForEach(ph => ph.Visible = region == ph);

        if (region == phSetQuestions)
        {
            new UserServiceClient().Using(client =>
            {
                var application_info = client.GetApplicationInformation();
                var questions        = new int[application_info.NumberOfPasswordResetQuestions];
                for (int x = 0; x < questions.Length; x++)
                {
                    questions[x] = x + 1;
                }
                repQuestions.DataSource = questions;
                Questions     = application_info.Questions;
                QuestionCount = application_info.NumberOfPasswordResetQuestions;
            });
        }
        else if (region == phForgotPassword && !String.IsNullOrEmpty(Username))
        {
            new UserServiceClient().Using(client =>
            {
                var questions         = client.GetUserQuestions(Username).ReturnValue as UserQuestion[];
                phNoQuestions.Visible = questions == null || questions.Count() == 0;
                phQuestions.Visible   = !phNoQuestions.Visible;
                repAnswers.DataSource = questions;
            });
        }
        region.DataBind();
    }
Esempio n. 4
0
        protected void BtnNewOrderClick(object sender, EventArgs e)
        {
            Session["IsFirstLoad"] = "true";
            Page        mp  = (Page)this.Parent.Page;
            PlaceHolder ph  = (PlaceHolder)mp.FindControl("phForms");
            UpdatePanel upt = (UpdatePanel)mp.FindControl("updtForms");

            Session["CurrentFormName"] = "frmLabOrderTouch";

            Touch.Custom_Forms.frmLabOrderTouch fr = (frmLabOrderTouch)mp.LoadControl("~/Touch/Custom Forms/frmLabOrderTouch.ascx");

            fr.ID = "ID" + Session["CurrentFormName"].ToString();
            frmLabOrderTouch theFrm = (frmLabOrderTouch)ph.FindControl("ID" + Session["CurrentFormName"].ToString());


            // Handle Save button
            HiddenField Phf  = (HiddenField)mp.FindControl("hdSaveBtnVal");
            UpdatePanel updt = (UpdatePanel)mp.FindControl("updtPatientSave");

            Phf.Value = fr.ID + "_btnSave_input";
            updt.Update();
            RadScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "shwSve", "$('#divSave').css('display', 'block');", true);

            // END


            foreach (Control item in ph.Controls)
            {
                ph.Controls.Remove(item);
                //item.Visible = false;
            }

            if (theFrm != null)
            {
                theFrm.Visible = true;
            }
            else
            {
                ph.Controls.Add(fr);
            }
            ph.DataBind();
            upt.Update();
            mp.ClientScript.RegisterStartupScript(mp.GetType(), "settabschild", "setTabs();");
        }
        protected void rgviewpharmacyform_ItemCommand(object sender, GridCommandEventArgs e)
        {
            GridDataItem item1      = (GridDataItem)e.Item;
            string       strOrderID = item1.GetDataKeyValue("OrderID").ToString();

            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "loadpharm", "parent.ShowLoading()", true);
            Session["IsFirstLoad"] = "true";
            Page        mp  = (Page)this.Parent.Page;
            PlaceHolder ph  = (PlaceHolder)mp.FindControl("phForms");
            UpdatePanel upt = (UpdatePanel)mp.FindControl("updtForms");

            Session["CurrentFormName"] = "frmPharmacyTouch";

            frmPharmacyTouch fr = (frmPharmacyTouch)mp.LoadControl("frmPharmacyTouch.ascx");

            Session["Orderid"] = Convert.ToInt32(strOrderID);
            fr.ID = "ID" + Session["CurrentFormName"].ToString();
            frmVisitTouch theFrm = (frmVisitTouch)ph.FindControl("ID" + Session["CurrentFormName"].ToString());

            foreach (Control item in ph.Controls)
            {
                ph.Controls.Remove(item);
                //item.Visible = false;
            }

            if (theFrm != null)
            {
                theFrm.Visible = true;
            }
            else
            {
                ph.Controls.Add(fr);
            }
            ph.DataBind();
            upt.Update();
            mp.ClientScript.RegisterStartupScript(mp.GetType(), "settabschild", "setTabs();");
        }
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (Extender.AdapterEnabled)
            {
                DataList dataList = Control as DataList;
                if (dataList != null)
                {
                    writer.Indent++;
                    writer.WriteLine();
                    writer.WriteBeginTag("table");
                    writer.WriteAttribute("cellpadding", "0");
                    writer.WriteAttribute("cellspacing", "0");
                    writer.WriteAttribute("summary", Control.ToolTip);
                    writer.Write(HtmlTextWriter.TagRightChar);
                    writer.Indent++;

                    if (dataList.HeaderTemplate != null)
                    {
                        PlaceHolder container = new PlaceHolder();
                        dataList.HeaderTemplate.InstantiateIn(container);
                        container.DataBind();

                        if ((container.Controls.Count == 1) && typeof(LiteralControl).IsInstanceOfType(container.Controls[0]))
                        {
                            writer.WriteLine();
                            writer.WriteBeginTag("caption");
                            writer.Write(HtmlTextWriter.TagRightChar);

                            LiteralControl literalControl = container.Controls[0] as LiteralControl;
                            writer.Write(literalControl.Text.Trim());

                            writer.WriteEndTag("caption");
                        }
                        else
                        {
                            writer.WriteLine();
                            writer.WriteBeginTag("thead");
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            writer.WriteLine();
                            writer.WriteBeginTag("tr");
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            writer.WriteLine();
                            writer.WriteBeginTag("th");
                            writer.WriteAttribute("colspan", RepeatColumns.ToString());
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            writer.WriteLine();
                            container.RenderControl(writer);

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("th");

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("tr");

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("thead");
                        }
                    }

                    if (dataList.FooterTemplate != null)
                    {
                        writer.WriteLine();
                        writer.WriteBeginTag("tfoot");
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        writer.WriteLine();
                        writer.WriteBeginTag("tr");
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        writer.WriteLine();
                        writer.WriteBeginTag("td");
                        writer.WriteAttribute("colspan", RepeatColumns.ToString());
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        PlaceHolder container = new PlaceHolder();
                        dataList.FooterTemplate.InstantiateIn(container);
                        container.DataBind();
                        container.RenderControl(writer);

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("td");

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("tr");

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("tfoot");
                    }

                    if (dataList.ItemTemplate != null)
                    {
                        writer.WriteLine();
                        writer.WriteBeginTag("tbody");
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        int nItemsInColumn = (int)Math.Ceiling(((Double)dataList.Items.Count) / ((Double)RepeatColumns));
                        for (int iItem = 0; iItem < dataList.Items.Count; iItem++)
                        {
                            int nRow          = iItem / RepeatColumns;
                            int nCol          = iItem % RepeatColumns;
                            int nDesiredIndex = iItem;
                            if (dataList.RepeatDirection == RepeatDirection.Vertical)
                            {
                                nDesiredIndex = (nCol * nItemsInColumn) + nRow;
                            }

                            if ((iItem % RepeatColumns) == 0)
                            {
                                writer.WriteLine();
                                writer.WriteBeginTag("tr");
                                writer.Write(HtmlTextWriter.TagRightChar);
                                writer.Indent++;
                            }

                            writer.WriteLine();
                            writer.WriteBeginTag("td");
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            foreach (Control itemCtrl in dataList.Items[iItem].Controls)
                            {
                                itemCtrl.RenderControl(writer);
                            }

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("td");

                            if (((iItem + 1) % RepeatColumns) == 0)
                            {
                                writer.Indent--;
                                writer.WriteLine();
                                writer.WriteEndTag("tr");
                            }
                        }

                        if ((dataList.Items.Count % RepeatColumns) != 0)
                        {
                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("tr");
                        }

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("tbody");
                    }

                    writer.Indent--;
                    writer.WriteLine();
                    writer.WriteEndTag("table");

                    writer.Indent--;
                    writer.WriteLine();
                }
            }
            else
            {
                base.RenderContents(writer);
            }
        }