예제 #1
0
파일: Program.cs 프로젝트: aevv/Biscuit
        static void Main(string[] args)
        {
            // Initial setup for the game to work.
            PacketRegister.CreateRegistry();
            ConfigManager<ConfigMappings> config = ConfigManager<ConfigMappings>.Resolve("settings.ini");
            Connection connection = Connection.Create(config);
            FormManager formManager = new FormManager();
            Game game = new Game(connection, formManager, config, Convert.ToDouble(Resources.VERSION));
            formManager.Game = game;

            LoginForm form = formManager.OpenOrGetForm<LoginForm>();
            var result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                formManager.DisposeForm(form);
                game.Run(120, 120);
            }
        }
예제 #2
0
    private void GetAllPatientForms()
    {
        string   formName = "";
        DateTime theDate;
        int      PtnPMTCTStatus = 0;
        int      PtnARTStatus   = 0;

        int phar = Convert.ToInt32(Session["PatientVisitId"]);

        int      tmpYear  = 0;
        int      tmpMonth = 0;
        TreeNode root     = new TreeNode();
        TreeNode theMRoot = new TreeNode();
        bool     flagyear = true;

        //int PtnPMTCTStatus = 0;
        //int PtnARTStatus = 0;



        if (PtnSts == "0")
        {
            if (Session["PtnPrgStatus"] != null)
            {
                DataTable theStatusDT = (DataTable)Session["PtnPrgStatus"];
                if (theStatusDT.Rows[0]["PMTCTStatus"].ToString() == "PMTCT Care Ended")
                {
                    PtnPMTCTStatus = 1;
                }
                else
                {
                    PtnPMTCTStatus = 0;
                }
                if (theStatusDT.Rows[0]["ART/PalliativeCare"].ToString() == "Care Ended")
                {
                    PtnARTStatus = 1;
                }
                else
                {
                    PtnARTStatus = 0;
                }
            }
        }

        IDeleteForm FormManager;

        //IPatientHome PatientManager;
        try
        {
            //PId = Request.QueryString["PatientId"].ToString();
            PId = Session["PatientId"].ToString();

            //PatientManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");

            //IFacilitySetup FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
            FormManager = (IDeleteForm)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BDeleteForm, BusinessProcess.Clinical");
            DataSet theDS = FormManager.GetPatientForms(Convert.ToInt32(PId));
            //ViewState["theCFDT"] = theDS.Tables[2];
            ViewState["theCFDT"] = theDS.Tables[3].Copy();

            DataView dv = theDS.Tables[1].DefaultView;

            dv.Sort = "FormName";
            DataTable dt = dv.ToTable();

            LocationID = Convert.ToInt32(theDS.Tables[0].Rows[0]["LocationID"].ToString());

            //TreeNode root = new TreeNode();
            //TreeNode theFrmRoot = new TreeNode();



            //foreach (DataRow theDR in dt.Rows)
            //{
            //    if (formName != theDR["FormName"].ToString())
            //    {
            //        root = new TreeNode();
            //        root.Text = theDR["FormName"].ToString();
            //        root.Target = "_blank";
            //        TreeViewExistingForm.Nodes.Add(root);
            //        formName = theDR["FormName"].ToString();
            //    }

            //    if (theDR["TranDate"] != System.DBNull.Value)
            //    {

            //            theFrmRoot = new TreeNode();

            //            theDate = Convert.ToDateTime(theDR["TranDate"].ToString());
            //            //theFrmRoot.Text = theDate.ToString(Session["AppDateFormat"].ToString());
            //            theFrmRoot.Text = theDR["FormName"].ToString() + " ( " + theDate.ToString(Session["AppDateFormat"].ToString()) + " )";
            //            theFrmRoot.Target = "";
            //            theFrmRoot.Value = Convert.ToInt32(PId) + "%" + theDR["OrderNo"].ToString() + "%" + theDR["LocationID"].ToString() + "%" + PtnARTStatus;
            //            root.ChildNodes.Add(theFrmRoot);

            //    }
            //    string url;


            foreach (DataRow theDR in theDS.Tables[1].Rows)
            {
                if ((theDR["FormName"].ToString() != "Patient Registration") && (theDR["FormName"].ToString() != "HIV-Enrollment") && (theDR["FormName"].ToString() != "Initial Evaluation"))
                {
                    if (((DateTime)theDR["TranDate"]).Year != 1900)
                    {
                        DQ = "";
                        if (tmpYear != ((DateTime)theDR["TranDate"]).Year)
                        {
                            root       = new TreeNode();
                            root.Text  = ((DateTime)theDR["TranDate"]).Year.ToString();
                            root.Value = "";
                            if (flagyear)
                            {
                                root.Expand();
                                flagyear = false;
                            }
                            else
                            {
                                root.Collapse();
                            }
                            TreeViewExisForm.Nodes.Add(root);
                            tmpYear  = ((DateTime)theDR["TranDate"]).Year;
                            tmpMonth = 0;
                        }

                        if (tmpYear == ((DateTime)theDR["TranDate"]).Year && tmpMonth != ((DateTime)theDR["TranDate"]).Month)
                        {
                            theMRoot       = new TreeNode();
                            theMRoot.Text  = ((DateTime)theDR["TranDate"]).ToString("MMMM");
                            theMRoot.Value = "";
                            root.ChildNodes.Add(theMRoot);
                            tmpMonth = ((DateTime)theDR["TranDate"]).Month;
                        }

                        if (theDR["DataQuality"].ToString() == "1")
                        {
                            DQ = "Data Quality Done";
                        }

                        if (tmpYear == ((DateTime)theDR["TranDate"]).Year && tmpMonth == ((DateTime)theDR["TranDate"]).Month)
                        {
                            this.LocationID = Convert.ToInt32(theDS.Tables[0].Rows[0]["LocationID"].ToString());
                            TreeNode theFrmRoot = new TreeNode();
                            //theFrmRoot.NavigateUrl = "";
                            theFrmRoot.Text = theDR["FormName"].ToString() + " ( " + ((DateTime)theDR["TranDate"]).ToString(Session["AppDateFormat"].ToString()) + " )";
                            if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || theDR["FormName"].ToString() == "Patient Registration")
                            {
                                if (DQ != "")
                                {
                                    theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                }
                                else
                                {
                                    theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                }
                            }
                            else
                            {
                                if (Convert.ToInt32(theDR["Module"]) > 2)
                                {
                                    theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                    theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                    theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                }
                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Paediatric Pharmacy"))
                                {
                                    if (Session["Paperless"].ToString() == "1")
                                    {
                                        if (theDR["CAUTION"].ToString() == "1")
                                        {
                                            theFrmRoot.ImageUrl = "~/images/caution.png";
                                        }
                                    }
                                    else
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./Pharmacy/frmPharmacy_Paediatric.aspx?name=Delete";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }
                                }

                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Laboratory"))
                                {
                                    //if ((theDR["FormName"].ToString() == "Laboratory") && (Convert.ToString(Session["TechnicalAreaId"]) != "0") && (Convert.ToInt32(Session["TechnicalAreaId"]) > 2))
                                    //{
                                    //    theFrmRoot.ImageUrl = "~/Images/lock.jpg";
                                    //    theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                    //    theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                    //}
                                    //else
                                    //{
                                    if (Session["Paperless"].ToString() == "1")
                                    {
                                        if (theDR["CAUTION"].ToString() == "1")
                                        {
                                            theFrmRoot.ImageUrl = "~/images/caution.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                    }
                                    else
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./Laboratory/frmLabOrder.aspx?name=Delete";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }
                                    //}
                                }

                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Pharmacy"))
                                {
                                    if ((theDR["FormName"].ToString() == "Pharmacy") && (Convert.ToInt32(Session["TechnicalAreaId"]) > 2))
                                    {
                                        theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                        theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                        theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                    }
                                    else
                                    {
                                        if ((Convert.ToString(theDR["ID"]) == "222") && (Convert.ToString(Session["TechnicalAreaId"]) == "1"))
                                        {
                                            theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                            theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                            theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                        }
                                        else if ((Convert.ToString(theDR["ID"]) == "223") && (Convert.ToString(Session["TechnicalAreaId"]) == "2"))
                                        {
                                            theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                            theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                            theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                        }
                                        else
                                        {
                                            if (Session["Paperless"].ToString() == "1")
                                            {
                                                if (theDR["CAUTION"].ToString() == "1")
                                                {
                                                    theFrmRoot.ImageUrl = "~/images/caution.png";
                                                }
                                                else
                                                {
                                                    theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                                }
                                            }
                                            else
                                            {
                                                if (DQ != "")
                                                {
                                                    //theFrmRoot.NavigateUrl = "~/./Pharmacy/frmPharmacy_Adult.aspx?name=Delete";
                                                    theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                                }
                                                else
                                                {
                                                    theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                                }
                                            }
                                        }
                                    }
                                }

                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "ART Follow-Up"))
                                {
                                    if (Convert.ToString(Session["TechnicalAreaId"]) == "2")
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./frmClinical_ARTFollowup.aspx?name=Delete";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }
                                    else
                                    {
                                        theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                        theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                        theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                    }
                                }
                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Home Visit"))
                                {
                                    if (Convert.ToString(Session["TechnicalAreaId"]) == "2")
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./Scheduler/frmScheduler_HomeVisit.aspx?name=Delete";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }
                                    else
                                    {
                                        theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                        theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                        theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                    }
                                }

                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Non-ART Follow-Up"))
                                {
                                    if (Convert.ToString(Session["TechnicalAreaId"]) == "2")
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./Pharmacy/frmPharmacy_Paediatric.aspx?name=Delete";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }
                                    else
                                    {
                                        theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                        theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                        theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                    }
                                }

                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Care Tracking"))
                                {
                                    if (Convert.ToString(Session["TechnicalAreaId"]) == "2")
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./Scheduler/frmScheduler_ContactCareTrackingnew.aspx?name=Delete";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }
                                    else
                                    {
                                        theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                        theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                        theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                    }
                                }

                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Paediatric Pharmacy"))
                                {
                                    if (Session["Paperless"].ToString() == "1")
                                    {
                                        if (theDR["CAUTION"].ToString() == "1")
                                        {
                                            theFrmRoot.ImageUrl = "~/images/caution.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                    }
                                    else
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./Pharmacy/frmPharmacy_Paediatric.aspx?name=Delete";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }
                                }

                                else if (Convert.ToString(Session["TechnicalAreaId"]) == Convert.ToString(theDR["Module"]) || (theDR["FormName"].ToString() == "Initial Evaluation"))
                                {
                                    if (Convert.ToString(Session["TechnicalAreaId"]) == "2")
                                    {
                                        if (DQ != "")
                                        {
                                            //theFrmRoot.NavigateUrl = "~/./frmClinical_InitialEvaluation.aspx?name=Edit";
                                            theFrmRoot.ImageUrl = "~/images/15px-Yes_check.svg.png";
                                        }
                                        else
                                        {
                                            theFrmRoot.ImageUrl = "~/Images/No_16x.ico";
                                        }
                                    }

                                    else

                                    {
                                        theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                        theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                        theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                    }
                                }

                                else
                                {
                                    theFrmRoot.ImageUrl     = "~/Images/lock.jpg";
                                    theFrmRoot.ImageToolTip = "You are Not Authorized to Access this Functionality";
                                    theFrmRoot.SelectAction = TreeNodeSelectAction.None;
                                }
                            }
                            theFrmRoot.NavigateUrl = "";
                            theFrmRoot.Value       = Convert.ToInt32(PId) + "%" + theDR["OrderNo"].ToString() + "%" + theDR["LocationID"].ToString() + "%" + PtnARTStatus + "%" + theDR["Module"].ToString() + "%" + theDR["FormName"].ToString();
                            theMRoot.ChildNodes.Add(theFrmRoot);
                        }
                    }
                }
            }



            // Link for Custom/Dynamic Forms
            //foreach (DataRow DRCustomFrm in theDS.Tables[2].Rows)
            //{
            //    if (DRCustomFrm["FeatureName"].ToString() == theDR["FormName"].ToString())
            //    {
            //        url = string.Format("{0}&patientid={1}&visitid={2}&locationid={3}&FormID={4}&sts={5}", "./frmClinical_CustomForm.aspx?name=Delete", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), theDR["LocationID"].ToString(), DRCustomFrm["FeatureID"].ToString(), PtnPMTCTStatus);
            //        theFrmRoot.NavigateUrl = url;
            //    }
            //}



            /********* Redirct to selected form ************/
            //switch (theDR["FormName"].ToString())
            //{
            //    //case "Enrollment": url = string.Format("{0}&patientid={1}&visitid={2}&locationid={3}&sts={4}", "./frmClinical_Enrolment.aspx?name=Edit", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), LocationID, PtnSts.ToString());
            //    //    theFrmRoot.NavigateUrl = url;
            //    //    break;
            //    //case "Initial Evaluation": url = string.Format("{0}&patientid={1}&visitid={2}&locationid={3}&sts={4}", "./frmClinical_InitialEvaluation.aspx?name=Edit", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), LocationID, PtnSts.ToString());
            //    //    theFrmRoot.NavigateUrl = url;
            //    //    break;
            //    case "ART Follow-Up": url = string.Format("{0}", "./frmClinical_ARTFollowup.aspx?name=Delete");
            //    //case "ART Follow-Up": url = string.Format("{0}&patientid={1}&visitid={2}&sts={3}", "./frmClinical_ARTFollowup.aspx?name=Delete", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), PtnSts.ToString());
            //        theFrmRoot.NavigateUrl = url;
            //        break;
            //    case "Pharmacy":
            //        if (Session["SystemId"].ToString() == "2")
            //        {
            //            url = string.Format("{0}&PatientId={1}&PharmacyId={2}&visitid={3}&sts={4}&locationid={5}", "~/./Pharmacy/frmPharmacy_CTC.aspx?name=Delete", Convert.ToInt32(PId), theDR["PharmacyNo"].ToString(), theDR["OrderNo"].ToString(), PtnSts.ToString(), theDR["LocationID"].ToString());
            //        }
            //        else
            //        {
            //            url = string.Format("{0}&PatientId={1}&PharmacyId={2}&visitid={3}&sts={4}&locationid={5}", "~/./Pharmacy/frmPharmacy_Adult.aspx?name=Delete", Convert.ToInt32(PId), theDR["PharmacyNo"].ToString(), theDR["OrderNo"].ToString(), PtnSts.ToString(), theDR["LocationID"].ToString());
            //            //url=string.Format("{0}&patientid={1}&PharmacyID={2}&sts={3}", "~/./Pharmacy/frmPharmacy_Adult.aspx?name=Delete", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), PtnSts.ToString());
            //        }

            //        theFrmRoot.NavigateUrl = url;
            //        break;
            //    case "Laboratory": url = string.Format("{0}&patientid={1}&LabID={2}&sts={3}", "~/./Laboratory/frmLabOrder.aspx?name=Delete", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), PtnSts.ToString());
            //        theFrmRoot.NavigateUrl = url;
            //        break;
            //    case "Home Visit": url = string.Format("{0}&patientid={1}&OrderId={2}&sts={3}&locationid{4}", "~/./Scheduler/frmScheduler_HomeVisit.aspx?name=Delete", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), PtnSts.ToString(), theDR["LocationID"].ToString());
            //        theFrmRoot.NavigateUrl = url;
            //        break;
            //    case "Paediatric Pharmacy": url = string.Format("{0}&PatientId={1}&PharmacyId={2}&visitid={3}&sts={4}&locationid={5}", "~/./Pharmacy/frmPharmacy_Paediatric.aspx?name=Delete", Convert.ToInt32(PId), theDR["PharmacyNo"].ToString(), theDR["OrderNo"].ToString(), PtnSts.ToString(), theDR["LocationID"].ToString());
            //        //string.Format("{0}&patientid={1}&PharmacyID={2}&sts={3}", "~/./Pharmacy/frmPharmacy_Paediatric.aspx?name=Delete", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), PtnSts.ToString());
            //        theFrmRoot.NavigateUrl = url;
            //        break;
            //    case "Non-ART Follow-Up": url = string.Format("{0}&PatientId={1}&PharmacyID={2}&visitid={3}&sts={4}", "./frmClinical_NonARTFollowUp.aspx?name=Delete", Convert.ToInt32(PId), theDR["PharmacyNo"].ToString(), theDR["OrderNo"].ToString(), PtnSts.ToString());
            //        theFrmRoot.NavigateUrl = url;
            //        break;

            //    case "Patient Record - Follow Up": url = string.Format("{0}&patientid={1}&visitid={2}&sts={3}", "./frmClinical_PatientRecordCTC.aspx?name=Delete", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), PtnSts.ToString());
            //        theFrmRoot.NavigateUrl = url;
            //        break;
            //    //case "Care Tracking": url = string.Format("{0}&PatientId={1}&TrackingId={2}&CareendedId={3}&sts={4}", "~/./Scheduler/frmScheduler_ContactCareTrackingnew.aspx?name=Edit", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), theDR["PharmacyNo"].ToString(), PtnSts.ToString());
            //    //    theFrmRoot.NavigateUrl = url;
            //    //    break;

            //    default: break;
            //}
        }


        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            FormManager = null;
        }
    }
예제 #3
0
 private FormController()
 {
     FormManager.Instance().OnMainFormClosing += this.FormController_OnMainFormClosing;
 }
예제 #4
0
        void Examples()
        {
            #region Color Picker

            colorPicker = new Form(10, 10, 400, 200, new Color(14, 14, 14))
            {
                IsVisible   = true,
                IsResizable = true,
            };

            colorPicker.AddNewControl(h_val = new Slider(20, 50, 300, 10, Slider.Type.Horizontal)
            {
                Filler = Slider.FillStyle.Slider
            });
            colorPicker.AddNewControl(s_val = new Slider(20, 70, 300, 10, Slider.Type.Horizontal)
            {
                Filler = Slider.FillStyle.Slider
            });
            colorPicker.AddNewControl(v_val = new Slider(20, 90, 300, 10, Slider.Type.Horizontal)
            {
                Filler = Slider.FillStyle.Slider
            });

            h_val.OnSlide += delegate { colorPicker.FormColor = Palette.HSV2RGB(360 * h_val.Value, s_val.Value, v_val.Value); };
            s_val.OnSlide += delegate { colorPicker.FormColor = Palette.HSV2RGB(360 * h_val.Value, s_val.Value, v_val.Value); };
            v_val.OnSlide += delegate { colorPicker.FormColor = Palette.HSV2RGB(360 * h_val.Value, s_val.Value, v_val.Value); };

            colorPicker.CreateLayout(hud_form_headname, hud_form_headseam, hud_form_headend, hud_form_leftborder, hud_form_rightborder, hud_form_bottomleft, hud_form_bottomseam, hud_form_bottomright);

            FormManager.AddForm("colorPicker", colorPicker);
            #endregion

            #region Calc
            var f = new Form(340, 100, 310, 320, new Color(40, 40, 40))
            {
                IsVisible = true
            };
            f.CreateLayout(hud_form_headname,
                           hud_form_headseam,
                           hud_form_headend,
                           hud_form_leftborder,
                           hud_form_rightborder,
                           hud_form_bottomleft,
                           hud_form_bottomseam,
                           hud_form_bottomright);

            Textarea lb;

            Button b1, b2, b3, b4, b5, b6, b7, b8, b9, b0,
                   bex, bdiv, bmul, bsub, bsum,
                   er;

            var buttonx = 50;
            var buttony = 40;
            f.AddNewControl(
                lb = new Textarea(buttonx + 10, buttony + 10, 140, 30)
            {
                Font = font1
            },
                er = new Button(buttonx + 160, buttony + 10, 40, 30)
            {
                Text = "<="
            },
                b1 = new Button(buttonx + 10, buttony + 50, 40, 40)
            {
                Text = "1"
            },
                b2 = new Button(buttonx + 60, buttony + 50, 40, 40)
            {
                Text = "2"
            },
                b3 = new Button(buttonx + 110, buttony + 50, 40, 40)
            {
                Text = "3"
            },
                b4 = new Button(buttonx + 10, buttony + 100, 40, 40)
            {
                Text = "4"
            },
                b5 = new Button(buttonx + 60, buttony + 100, 40, 40)
            {
                Text = "5"
            },
                b6 = new Button(buttonx + 110, buttony + 100, 40, 40)
            {
                Text = "6"
            },
                b7 = new Button(buttonx + 10, buttony + 150, 40, 40)
            {
                Text = "7"
            },
                b8 = new Button(buttonx + 60, buttony + 150, 40, 40)
            {
                Text = "8"
            },
                b9 = new Button(buttonx + 110, buttony + 150, 40, 40)
            {
                Text = "9"
            },
                b0 = new Button(buttonx + 10, buttony + 200, 90, 40)
            {
                Text = "0"
            },
                bex = new Button(buttonx + 110, buttony + 200, 40, 40)
            {
                Text = "="
            },
                bdiv = new Button(buttonx + 160, buttony + 50, 40, 40)
            {
                Text = "/"
            },
                bmul = new Button(buttonx + 160, buttony + 100, 40, 40)
            {
                Text = "*"
            },
                bsub = new Button(buttonx + 160, buttony + 150, 40, 40)
            {
                Text = "-"
            },
                bsum = new Button(buttonx + 160, buttony + 200, 40, 40)
            {
                Text = "+"
            }
                );

            lb.Text = "0";

            List <Button> digs = new List <Button>()
            {
                b1, b2, b3, b4, b5, b6, b7, b8, b9, b0
            };
            List <Button> acts = new List <Button>()
            {
                bdiv, bmul, bsub, bsum
            };
            String v1 = "";

            Func <string> div = delegate { return((int.Parse(v1) / int.Parse(lb.Text)).ToString()); };
            Func <string> mul = delegate { return((int.Parse(v1) * int.Parse(lb.Text)).ToString()); };
            Func <string> sub = delegate { return((int.Parse(v1) - int.Parse(lb.Text)).ToString()); };
            Func <string> sum = delegate { return((int.Parse(v1) + int.Parse(lb.Text)).ToString()); };

            Func <string> sel = null;

            digs.ForEach(n => n.OnLeftClick += delegate
            {
                if (lb.Text == "0")
                {
                    lb.Text = n.Text;
                }
                else
                {
                    lb.Append = n.Text;
                }
            });

            acts.ForEach(n => n.OnLeftClick += delegate
            {
                if (sel == null && lb.Text.Length > 0)
                {
                    sel     = n.Text == "/" ? div : n.Text == "*" ? mul : n.Text == "-" ? sub : sum;
                    v1      = lb.Text;
                    lb.Text = "0";
                }
            });

            bex.OnLeftClick += delegate
            {
                if (sel != null)
                {
                    lb.Text = sel();
                    sel     = null;
                }
            };

            er.OnLeftClick += delegate
            {
                lb.Text = lb.Text.Length == 1 ? "0" : lb.Text.Substring(0, lb.Text.Length - 1);
            };

            FormManager.AddForm("CalcForm", f);
            #endregion
        }
예제 #5
0
        public IHttpActionResult Export()
        {
            try
            {
                var request = Context.AuthenticatedRequest;

                var formInfo = FormManager.GetFormInfoByPost(request);
                if (formInfo == null)
                {
                    return(NotFound());
                }
                if (!request.IsAdminLoggin || !request.AdminPermissions.HasSitePermissions(formInfo.SiteId, FormUtils.MenuFormsPermission))
                {
                    return(Unauthorized());
                }

                var fieldInfoList = FieldManager.GetFieldInfoList(formInfo.Id);
                var logs          = LogManager.Repository.GetAllLogInfoList(formInfo);

                var head = new List <string> {
                    "编号"
                };
                foreach (var fieldInfo in fieldInfoList)
                {
                    head.Add(fieldInfo.Title);
                }
                head.Add("添加时间");

                var rows = new List <List <string> >();

                foreach (var log in logs)
                {
                    var row = new List <string>
                    {
                        log.Guid
                    };
                    foreach (var fieldInfo in fieldInfoList)
                    {
                        row.Add(LogManager.GetValue(fieldInfo, log));
                    }

                    if (log.AddDate.HasValue)
                    {
                        row.Add(log.AddDate.Value.ToString("yyyy-MM-dd HH:mm"));
                    }

                    rows.Add(row);
                }

                var fileName = $"{formInfo.Title}.csv";
                CsvUtils.Export(Context.PluginApi.GetPluginPath(FormUtils.MenuFormsPermission, fileName), head, rows);
                var downloadUrl = Context.PluginApi.GetPluginUrl(FormUtils.MenuFormsPermission, fileName);

                return(Ok(new
                {
                    Value = downloadUrl
                }));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
예제 #6
0
 public StatusBarEx GetStatusBar()
 {
     return(FormManager.GetMainForm().GetStatusBar());
 }
예제 #7
0
    //protected void grdSearchResult_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    //GridViewRow row = grdSearchResult.SelectedRow;
    //    //txtAppDate.Value = row.Cells[0].Text;
    //}


    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        IAppointment FormManager;
        int          theResultRow = 0;
        DateTime     currentDate;


        DateTime enteredDate;

        try
        {
            //*******First check whether the appointment date, purpose and provider is being selected*******//
            IQCareUtils theUtil = new IQCareUtils();
            if (checkEntriesShowMessages())
            {
                //*******Save all the details and create a new appointment*******//
                if (checkDate())
                {
                    if (AppointmentExist())
                    {
                        IQCareMsgBox.Show("AppointmentExist", this);
                        return;
                    }
                    else
                    {
                        //First check that appdate must be with in a year not greter then that
                        currentDate = getCurrentDate();
                        //enteredDate = Convert.ToDateTime(txtAppDate.Value);

                        enteredDate = Convert.ToDateTime(theUtil.MakeDate(txtAppDate.Value));

                        if (currentDate.AddYears(1) < enteredDate)
                        {
                            IQCareMsgBox.Show("AppointmentWithInAYear", this);
                            return;
                        }
                        //if (Request.QueryString["FormName"] != null)
                        //{
                        //    if ((Request.QueryString["FormName"] == "EditDelete") || (Request.QueryString["FormName"] == "Appointment History"))
                        //    {

                        //        //*******if redirected from appointment edit/delete then update the data*******//
                        //        FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
                        //        theResultRow = FormManager.UpdatePatientppointmentDetails(Convert.ToInt32(patientId), Convert.ToInt32(Request.QueryString["LocationID"]), Convert.ToInt32(Request.QueryString["PatientVisitID"]), Convert.ToDateTime(txtAppDate.Value), Convert.ToInt32(ddAppPurpose.SelectedValue),Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(ddAppProvider.SelectedValue), currentDate);


                        //    }
                        //}


                        patientId = Convert.ToInt32(Session["PatientId"].ToString());

                        if (btnSubmit.Text == "Save")
                        {
                            if (!editData)
                            {
                                //*******if redirected from appointment main then save the data*******//
                                FormManager    = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
                                theResultRow   = FormManager.SaveAppointment(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["AppLocationId"]), txtAppDate.Value, Convert.ToInt32(ddAppPurpose.SelectedValue), Convert.ToInt32(ddAppProvider.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToDateTime(Application["AppCurrentDate"]).ToString("dd-MMM-yyyy"));
                                btnSubmit.Text = "Update";
                            }
                        }
                        else if (btnSubmit.Text == "Update")
                        {
                            //IQCareUtils theUtils = new IQCareUtils();
                            currentDate = getCurrentDate();
                            //app  = Convert.ToDateTime(txtAppDate.Value);
                            app         = Convert.ToDateTime(theUtil.MakeDate(txtAppDate.Value));
                            FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
                            //theResultRow = FormManager.UpdatePatientppointmentDetails(Convert.ToInt32(patientId), Convert.ToInt32(Request.QueryString["LocationID"]), Convert.ToInt32(Request.QueryString["PatientVisitID"]), app, Convert.ToInt32(ddAppPurpose.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(ddAppProvider.SelectedValue), currentDate);
                            //theResultRow = FormManager.UpdatePatientppointmentDetails(Convert.ToInt32(patientId), Convert.ToInt32(Request.QueryString["LocationID"]), Convert.ToInt32(ViewState["VisitID"]), app, Convert.ToInt32(ddAppPurpose.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(ddAppProvider.SelectedValue), currentDate);
                            //update by-nidhi
                            //Desc- changing datetime to string
                            //theResultRow = FormManager.UpdatePatientppointmentDetails(patientId, Convert.ToInt32(Session["AppLocationId"]), Convert.ToInt32(ViewState["VisitID"]), app, Convert.ToInt32(ddAppPurpose.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(ddAppProvider.SelectedValue), currentDate);
                            theResultRow = FormManager.UpdatePatientppointmentDetails(patientId, Convert.ToInt32(Session["AppLocationId"]), Convert.ToInt32(ViewState["VisitID"]), txtAppDate.Value, Convert.ToInt32(ddAppPurpose.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(ddAppProvider.SelectedValue), currentDate.ToString("dd-MMM-yyyy"));
                            fillPatientAppointmntDetailsInGrid();
                            txtAppDate.Value            = "";
                            ddAppPurpose.SelectedIndex  = 0;
                            ddAppProvider.SelectedIndex = 0;
                            btnSubmit.Text = "Save";
                        }
                        if (theResultRow == 0)
                        {
                            IQCareMsgBox.Show("AppointmentCreationError", this);
                            return;
                        }
                        else
                        {
                            //theUrl = string.Format("{0}?&sts={1}", "./frmScheduler_AppointmentNew.aspx?name=Add", Request.QueryString["sts"].ToString());
                            //theUrl = string.Format("{0}?patientId={1}&theEnrollID={2}&LocationId={3}", "./frmScheduler_AppointmentNew.aspx?name=Add", Convert.ToInt32(Request.QueryString["PatientId"]), Request.QueryString["PatientEnrollmentID"].ToString(), Session["AppLocationId"].ToString());

                            if (Request.QueryString["FormName"] != null)
                            {
                                string theUrl;
                                if (Request.QueryString["FormName"] == "PatientHome")
                                {
                                    //theUrl = string.Format("{0}?PatientId={1}", "../ClinicalForms/frmPatient_Home.aspx", patientId);
                                    theUrl = string.Format("{0}?PatientId={1}&sts={2}", "../ClinicalForms/frmPatient_Home.aspx?name=Add", patientId, Request.QueryString["sts"].ToString());
                                    Response.Redirect(theUrl);
                                }

                                if ((Request.QueryString["FormName"] == "Appointment History") || (Request.QueryString["FormName"] == "Appointment History New"))
                                {
                                    //theUrl = string.Format("{0}&PatientId={1}&LocationId={2}&FormName={3}", "../Scheduler/frmScheduler_AppointmentHistory.aspx?name=Add", Convert.ToInt32(Request.QueryString["PatientId"]), Session["AppLocationId"].ToString(), "PatientHome");
                                    theUrl = string.Format("{0}&LocationId={1}&FormName={2}", "../Scheduler/frmScheduler_AppointmentHistory.aspx?name=Add", Session["AppLocationId"].ToString(), "PatientHome");
                                    Response.Redirect(theUrl);
                                }
                            }
                            //Response.Redirect(theUrl);
                            //Server.Transfer(theUrl);
                            fillPatientAppointmntDetailsInGrid();
                            txtAppDate.Value            = "";
                            ddAppPurpose.SelectedIndex  = 0;
                            ddAppProvider.SelectedIndex = 0;
                        }
                    }
                }
            }
            else
            {
                return;
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            FormManager = null;
        }
    }
예제 #8
0
파일: IOLogForm.cs 프로젝트: nxzzkj/lazyiot
 private void 导出TXTToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FormManager.ExportLog();
 }
예제 #9
0
 private void 新建工程ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FormManager.CreateProject();
 }
예제 #10
0
 private void 加载工程ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FormManager.LoadProject();
 }
예제 #11
0
 private void formBar_MouseDown(object sender, MouseEventArgs e)
 {
     FormManager.ConvertMessageMove(e, Handle);
 }
예제 #12
0
 /// <summary>
 /// Displays form
 /// </summary>
 /// <param name="title">Form title</param>
 /// <param name="widgets">Widgets of form</param>
 public abstract void DisplayForm(string title, FormManager form);
예제 #13
0
 public ElementManagerController(FormManager formManager)
 {
     _form = formManager;
 }
예제 #14
0
 // TODO: check if class is status -sensitive
 public virtual void Reset()
 {
     _form = null;
 }
예제 #15
0
        private void OpenAddForm(object sender, EventArgs e)
        {
            var form = FormManager.GetFormSelected(MenuOptionName.USERSADD);

            form.Show(this);
        }
예제 #16
0
파일: Core.cs 프로젝트: Rideu/monogame-crux
        protected override void Initialize()
        {
            base.Initialize();
            IsMouseVisible = true;

            uControl.SetDefaultFont = font1;

            #region Test
            Form f = new Form(30, 100, 550, 500, new Color(14, 14, 14))
            {
                IsResizable = true,
                IsVisible   = true
            };
            Button b;
            f.AddNewControl(b = new Button(460, 450, 70, 20, new Color(50, 50, 50))
            {
                Text = "Continue"
            });

            #region Sample text
            //Textarea t;
            //            f.AddNewControl(t = new Textarea(20, 55, 515, 280));

            //            (t as Textarea).Text =
            //@"How to... {#(65,160,216):p}Warp{@p}:
            //            ^n ^n1. Warp {#(65,160,216):h}tech{@p} is commonly used to travel between star systems, but for certain amount of energy or specific fuel to feed your warp core. Press Galaxy Map button (M by default) to view available stars to travel to. The sphere around your current star system shows the bounds within which you can warp.  Now click on any star. The number below star name shows, how much fuel is required to warp to this system. It's labeled as green if you have enough amount of energy and red otherwise. Now choose a reachable star to travel to and press Travel button. The Oscillation window opens. To increase travel stability and speed, you need to alter nodes of the oscillation graph according to the warp noise map: the more accuracy, the more effectivity. Since nodes values are initially precalculated, they also can be left as is, so the travel will take its usual time. Now press Apply button to launch the warp core and travel to the chosen system. Warp can take some time, depending on distance to target star and warp core properties.
            //            ^n ^n2. You also can initiate a wave overlap with the ship that has slower warp core, allowing you to stick with other ships during the travel. When this is possible, an notice appears, which displays current distance to the ship and possibility to do this maneuver: it uses significant amount of energy depending on initial warp jump point.
            //            ^n ^nHow to... Build:
            //            ^n ^n1. Buildings are primary things that makes the world live, cycle and expand. They are subdivided by their functionality: common factories, research laboratories and energy stations. All of them are consuming various resources, depending on how it is organized and supplied. To manage its work in more simple manner, node mechanic is used. Each node requires specific amount of workers and energy to function. There are three types of nodes in the game: source, processing and storage. Source nodes are consuming local resources depending on its type (mining or farming). Processing nodes are used to process incoming resources and provide the result to the next ones. Storage nodes sends all the incoming resources to the planetary storage to be distributed among other factories or for local sales or intake resources for continued processing. If there is a lack of workers or energy, the production will be limited or, in worst case, disabled, so dependency compliance and optimization are very important. If node's inner storage is overfilled, it can cause blocking state - incoming connections are filling up, keep consuming energy and spending working time, calling continued blocking chain, so the losses are increasing.
            //            ^n ^nBuilding sizes can be four types: small, large, complex or arcological. Small ones can contain up to 5 nodes plus one for storage, large can contain up to 20, complex up to 70 and arcological up to 160 nodes.
            //            ^n ^n2. The common factories can be built on wide range of surfaces, even on non-atmosphere planets or asteroids. The size is varied by small (up to 6 processing nodes) They need abundant amount of workers and energy.
            //            ";

            //            (t as Textarea).Font = font1;
            #endregion

            Panel p, pp;
            f.AddNewControl(p  = new Panel(20, 50, 200, 100, Palette.DarkenGray));
            p.AddNewControl(pp = new Panel(10, 10, 180, 80, new Color(40, 40, 40)));

            for (int i = 0; i < 5; i++)
            {
                pp.AddNewControl(b = new Button(10, 10 + 25 * i, 70, 20, new Color(50, 50, 50))
                {
                    Text = "Continue"
                });
            }

            f.CreateLayout(hud_form_headname,
                           hud_form_headseam,
                           hud_form_headend,
                           hud_form_leftborder,
                           hud_form_rightborder,
                           hud_form_bottomleft,
                           hud_form_bottomseam,
                           hud_form_bottomright);

            f.AddNewControl(new Label(10, 12, 170, 20)
            {
                Text = "How to Reference", TextSize = 0.9f, ForeColor = new Color(238, 195, 114)
            });

            FormManager.AddForm("MainForm", f);
            #endregion

            //Examples();

            Simplex.Init(GraphicsDevice);
        }
예제 #17
0
 private void btAdd_Click(object sender, EventArgs e)
 {
     FormManager.AddDrive();
     FormManager.LoadDriver(this.treeView, this.contextMenuStrip);
 }
예제 #18
0
    //int VisitID;
    #region "User Functions"
    //int currentDate;
    #region "Modified13June07(1)"
    private void fillDropDownList(int idPurpose, int idEmployee)
    {
        ////*******Get the patient details on the basis of Patient Enrollment Id and show the details.*******//
        //FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
        ////DataSet theDtSet = FormManager.GetEmployees(idEmployee);

        //appBind = new BindFunctions();
        //appBind.BindCombo(ddAppProvider, theDtSet.Tables[0],"EmployeeName", "EmployeeId" );

        ////DataSet theDtSetPurpose = FormManager.GetAppointmentReasons(idPurpose);
        //appBind = new BindFunctions();
        //appBind.BindCombo(ddAppPurpose, theDtSetPurpose.Tables[0], "Name", "Id");

        //{
        IAppointment FormManager;

        FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
        DataSet       theDtSet        = FormManager.GetEmployees(idEmployee);
        DataSet       theDtSetPurpose = FormManager.GetAppointmentReasons(idPurpose);
        BindFunctions appBind         = new BindFunctions();
        IQCareUtils   theUtils        = new IQCareUtils();

        if (Request.QueryString["Name"] == "Add")
        {
            //if (Convert.ToInt32(Session["PatientVisitId"]) == 0)
            //{
            DataView theDV = new DataView(theDtSet.Tables[0]);
            DataView TheDV = new DataView(theDtSetPurpose.Tables[0]);
            theDV.RowFilter = "DeleteFlag=0";
            TheDV.RowFilter = "DeleteFlag=0";
            DataTable DT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            if (Convert.ToInt32(Session["AppUserEmployeeId"]) > 0)
            {
                theDV           = new DataView(DT);
                theDV.RowFilter = "EmployeeId =" + Session["AppUserEmployeeId"].ToString();
                if (theDV.Count > 0)
                {
                    DT = theUtils.CreateTableFromDataView(theDV);
                }
            }
            DataTable TheDT = (DataTable)theUtils.CreateTableFromDataView(TheDV);
            //appBind.BindCombo(ddAppProvider, DT, "EmployeeName", "EmployeeId"); Bug ID 2707.....
            //BindUserDropdown(ddAppProvider, string.Empty);
            BindUserDropdown(ddAppProvider, Session["AppUserId"].ToString());
            appBind.BindCombo(ddAppPurpose, TheDT, "Name", "Id");
            theDV.Dispose();
            TheDV.Dispose();
            DT.Clear();
            TheDT.Clear();
        }



        //}


        else if (Request.QueryString["name"] == "Edit" || Request.QueryString["name"] == "Delete")
        {
            BindDropdownOrderBy(theDtSet.Tables[0].Rows[0]["EmployeeName"].ToString());
            this.ddAppProvider.SelectedValue = theDtSet.Tables[0].Rows[0]["EmployeeName"].ToString();

            //appBind.BindCombo(ddAppProvider, theDtSet.Tables[0], "EmployeeName", "EmployeeId");
            appBind.BindCombo(ddAppPurpose, theDtSetPurpose.Tables[0], "Name", "Id");
        }
    }
예제 #19
0
 private void CommDriveManageForm_Load(object sender, EventArgs e)
 {
     FormManager.LoadDriver(this.treeView, this.contextMenuStrip);
 }
예제 #20
0
        protected virtual void ComboBoxDefineNewProc(object sender, DeleReturnProc retProc)
        {
            ComboBoxEx comb = (ComboBoxEx)sender;

            FormManager.DisplayForm(comb.DataSourceBO, "", FormMode.Ok, false, retProc);
        }
예제 #21
0
 public MapPopOutForm()
 {
     InitializeComponent();
     FormManager.AddForm(this);
     FormClosing += (sender, e) => FormManager.RemoveForm(this);
 }
예제 #22
0
    public void savePos()
    {
        FormManager form = GameObject.FindObjectOfType <FormManager>();

        form.pos[pos] = id;
    }
예제 #23
0
        public IHttpActionResult Submit()
        {
            try
            {
                var request = Context.AuthenticatedRequest;

                var formInfo = FormManager.GetFormInfoByPost(request);
                if (formInfo == null)
                {
                    return(NotFound());
                }
                if (!request.IsAdminLoggin || !request.AdminPermissions.HasSitePermissions(formInfo.SiteId, FormUtils.PluginId))
                {
                    return(Unauthorized());
                }

                var type = request.GetPostString("type");
                if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.IsClosed)))
                {
                    formInfo.IsClosed = request.GetPostBool(nameof(FormInfo.IsClosed));
                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.Title)))
                {
                    formInfo.Title = request.GetPostString(nameof(FormInfo.Title));
                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.Description)))
                {
                    formInfo.Description = request.GetPostString(nameof(FormInfo.Description));
                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.IsReply)))
                {
                    formInfo.IsReply = request.GetPostBool(nameof(FormInfo.IsReply));
                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.PageSize)))
                {
                    formInfo.PageSize = request.GetPostInt(nameof(FormInfo.PageSize));
                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.IsTimeout)))
                {
                    formInfo.IsTimeout   = request.GetPostBool(nameof(FormInfo.IsTimeout));
                    formInfo.TimeToStart = FormUtils.ToDateTime(request.GetPostString(nameof(FormInfo.TimeToStart)));
                    formInfo.TimeToEnd   = FormUtils.ToDateTime(request.GetPostString(nameof(FormInfo.TimeToEnd)));
                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.IsCaptcha)))
                {
                    formInfo.IsCaptcha = request.GetPostBool(nameof(FormInfo.IsCaptcha));
                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.IsAdministratorSmsNotify)))
                {
                    formInfo.IsAdministratorSmsNotify     = request.GetPostBool(nameof(FormInfo.IsAdministratorSmsNotify));
                    formInfo.AdministratorSmsNotifyTplId  = request.GetPostString(nameof(FormInfo.AdministratorSmsNotifyTplId));
                    formInfo.AdministratorSmsNotifyKeys   = request.GetPostString(nameof(FormInfo.AdministratorSmsNotifyKeys));
                    formInfo.AdministratorSmsNotifyMobile = request.GetPostString(nameof(FormInfo.AdministratorSmsNotifyMobile));

                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.IsAdministratorMailNotify)))
                {
                    formInfo.IsAdministratorMailNotify      = request.GetPostBool(nameof(FormInfo.IsAdministratorMailNotify));
                    formInfo.AdministratorMailNotifyAddress = request.GetPostString(nameof(FormInfo.AdministratorMailNotifyAddress));

                    FormManager.Repository.Update(formInfo);
                }
                else if (FormUtils.EqualsIgnoreCase(type, nameof(FormInfo.IsUserSmsNotify)))
                {
                    formInfo.IsUserSmsNotify         = request.GetPostBool(nameof(FormInfo.IsUserSmsNotify));
                    formInfo.UserSmsNotifyTplId      = request.GetPostString(nameof(FormInfo.UserSmsNotifyTplId));
                    formInfo.UserSmsNotifyKeys       = request.GetPostString(nameof(FormInfo.UserSmsNotifyKeys));
                    formInfo.UserSmsNotifyMobileName = request.GetPostString(nameof(FormInfo.UserSmsNotifyMobileName));

                    FormManager.Repository.Update(formInfo);
                }

                return(Ok(new{}));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        IAppointment FormManager;
        int          theResultRow = 0;
        DateTime     currentDate;
        Boolean      editData = false;
        DateTime     enteredDate;

        try
        {
            //*******First check whether the appointment date, purpose and provider is being selected*******//
            IQCareUtils theUtil = new IQCareUtils();
            if (checkEntriesShowMessages())
            {
                //*******Save all the details and create a new appointment*******//
                if (checkDate())
                {
                    if (AppointmentExist())
                    {
                        IQCareMsgBox.Show("AppointmentExist", this);
                        return;
                    }
                    else
                    {
                        //First check that appdate must be with in a year not greter then that
                        currentDate = getCurrentDate();
                        //enteredDate = Convert.ToDateTime(txtAppDate.Text);


                        enteredDate = Convert.ToDateTime(theUtil.MakeDate(txtAppDate.Text));

                        if (currentDate.AddYears(1) < enteredDate)
                        {
                            IQCareMsgBox.Show("AppointmentWithInAYear", this);
                            return;
                        }
                        if (Request.QueryString["FormName"] != null)
                        {
                            if ((Request.QueryString["FormName"] == "EditDelete") || (Request.QueryString["FormName"] == "Appointment History"))
                            {
                                //*******if redirected from appointment edit/delete then update the data*******//
                                FormManager = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");

                                //theResultRow = FormManager.UpdatePatientppointmentDetails(Convert.ToInt32(patientId), Convert.ToInt32(Request.QueryString["LocationID"]), Convert.ToInt32(Request.QueryString["PatientVisitID"]), Convert.ToDateTime(txtAppDate.Text), Convert.ToInt32(ddAppPurpose.SelectedValue),Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(ddAppProvider.SelectedValue), currentDate);
                                theResultRow = FormManager.UpdatePatientppointmentDetails(Convert.ToInt32(patientId), Convert.ToInt32(Session["AppLocationId"]), Convert.ToInt32(Session["PatientVisitId"]), enteredDate, Convert.ToInt32(ddAppPurpose.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(ddAppProvider.SelectedValue), currentDate);
                                editData     = true;
                            }
                        }
                        if (!editData)
                        {
                            //*******if redirected from appointment main then save the data*******//
                            FormManager  = (IAppointment)ObjectFactory.CreateInstance("BusinessProcess.Scheduler.BAppointment, BusinessProcess.Scheduler");
                            theResultRow = FormManager.SaveAppointment(Convert.ToInt32(patientId), Convert.ToInt32(Session["AppLocationId"]), enteredDate, Convert.ToInt32(ddAppPurpose.SelectedValue), Convert.ToInt32(ddAppProvider.SelectedValue), Convert.ToInt32(Session["AppUserId"]), Convert.ToDateTime(Application["AppCurrentDate"]));
                        }
                        if (theResultRow == 0)
                        {
                            IQCareMsgBox.Show("AppointmentCreationError", this);
                            return;
                        }
                        else
                        {
                            string theUrl;
                            theUrl = string.Format("{0}", "./frmScheduler_AppointmentMain.aspx?name=Add");

                            if (Request.QueryString["FormName"] != null)
                            {
                                if (Request.QueryString["FormName"] == "PatientHome")
                                {
                                    theUrl = string.Format("{0}", "../ClinicalForms/frmPatient_Home.aspx?name=Add");
                                }

                                if ((Request.QueryString["FormName"] == "Appointment History") || (Request.QueryString["FormName"] == "Appointment History New"))
                                {
                                    //Session["PatientId"]
                                    //theUrl = string.Format("{0}&PatientId={1}&LocationId={2}&FormName={3}&sts={4}", "../Scheduler/frmScheduler_AppointmentHistory.aspx?name=Add", Convert.ToInt32(Request.QueryString["PatientId"]), Session["AppLocationId"].ToString(), "PatientHome", Request.QueryString["sts"].ToString());
                                    theUrl = string.Format("{0}&FormName={1}", "../Scheduler/frmScheduler_AppointmentHistory.aspx?name=Add", "PatientHome");
                                }
                            }
                            Response.Redirect(theUrl);
                            //Server.Transfer(theUrl);
                        }
                    }
                }
            }
            else
            {
                return;
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            FormManager = null;
        }
    }
예제 #25
0
 public static void OnButtonPress()
 {
     FormManager.OpenForms();
 }
예제 #26
0
 private void CreateNewMainForm()
 {
     Init(FormManager.Instance().GetDefaultMainForm())
     .InitNotify(false);
 }
예제 #27
0
 public void OnShutdown()
 {
     FormManager.SaveFormInstances();
     HotkeyManager.UnregisterAllHotkeys();
 }
예제 #28
0
 private void Close(object sender, RoutedEventArgs e)
 {
     BoundInfoOverlay.Stop();
     FormManager.DisablePositionalOverlay();
 }
예제 #29
0
 public void Stop()
 {
     OverlayLogic.Stop();
     FormManager.SaveFormInstances();
     HotkeyManager.UnregisterAllHotkeys();
 }
예제 #30
0
    void Start()
    {
        if (name == "State" || name == "Sex" || name == "Patient Select")
        {
            Dropdown menu = gameObject.GetComponent<Dropdown>();
            menu.onValueChanged.AddListener(delegate { CheckSelection(menu); });
        }
        else if(name == "Audio Mod" || name == "Visual Mod")
        {
            Toggle checkbox = gameObject.GetComponent<Toggle>();
            checkbox.onValueChanged.AddListener(delegate { UpdateBool(checkbox); });
            info = "true";

        }
        else
        {
            InputField input = gameObject.GetComponent<InputField>();
            InputField.SubmitEvent se = new InputField.SubmitEvent();
            se.AddListener(CheckInfo);
            input.onEndEdit = se;
        }

        manager = submit_button.GetComponent<FormManager>();
        manager.inputs.Add(name, this);
    }
예제 #31
0
        private static bool TreeTick()
        {
            if (!TreeRoot.IsRunning)
            {
                return(false);
            }
            OverlayViewModel.Instance.IsPausedString = MainSettingsModel.Instance.UsePause ? "ATB Paused" : "ATB Running";

            if (DateTime.Now < _pulseLimiter)
            {
                return(true);
            }
            _pulseLimiter = DateTime.Now.AddSeconds(3);

            AutoDuty.AutoSprint();
            AutoDuty.AutoDutyRoot();
            FormManager.SaveFormInstances();

            if (MainSettingsModel.Instance.UseAutoFace && GameSettingsManager.FaceTargetOnAction == false)
            {
                GameSettingsManager.FaceTargetOnAction = true;
            }

            if (!MainSettingsModel.Instance.UseAutoFace && GameSettingsManager.FaceTargetOnAction)
            {
                GameSettingsManager.FaceTargetOnAction = false;
            }

            //if (!MainSettingsModel.Instance.UseAutoTpsAdjust)
            //{
            if (TreeRoot.TicksPerSecond != (byte)MainSettingsModel.Instance.TpsAdjust)
            {
                TreeRoot.TicksPerSecond = (byte)MainSettingsModel.Instance.TpsAdjust;
            }
            return(true);
            //}

            //var currentTpsSetting = MainSettingsModel.Instance.TpsAdjust;

            //switch (_rbVersion)
            //{
            //    case 1:
            //        var currentFps32 = Core.Memory.Read<float>(Core.Memory.Read<IntPtr>(Core.Memory.ImageBase + 0x107e474) + 0x15d0);

            //        if (currentTpsSetting != 30 && currentFps32 >= 55)
            //            MainSettingsModel.Instance.TpsAdjust = 30;

            //        if (currentTpsSetting != 20 && IsWithin(currentFps32, 25, 35))
            //            MainSettingsModel.Instance.TpsAdjust = 20;

            //        if (currentTpsSetting != 10 && IsWithin(currentFps32, 10, 20))
            //            MainSettingsModel.Instance.TpsAdjust = 10;
            //        break;

            //    case 2:
            //        var currentFps64 = Core.Memory.Read<float>(Core.Memory.Read<IntPtr>(Core.Memory.ImageBase + 0x16b7508) + 0x186C);

            //        if (currentTpsSetting != 30 && currentFps64 >= 55)
            //            MainSettingsModel.Instance.TpsAdjust = 30;

            //        if (currentTpsSetting != 20 && IsWithin(currentFps64, 25, 35))
            //            MainSettingsModel.Instance.TpsAdjust = 20;

            //        if (currentTpsSetting != 10 && IsWithin(currentFps64, 10, 20))
            //            MainSettingsModel.Instance.TpsAdjust = 10;
            //        break;

            //    case 3:
            //        var currentFpscn = Core.Memory.Read<float>(Core.Memory.Read<IntPtr>(Core.Memory.ImageBase + 0x1039534) + 0x15c8);

            //        if (currentTpsSetting != 30 && currentFpscn >= 55)
            //            MainSettingsModel.Instance.TpsAdjust = 30;

            //        if (currentTpsSetting != 20 && IsWithin(currentFpscn, 25, 35))
            //            MainSettingsModel.Instance.TpsAdjust = 20;

            //        if (currentTpsSetting != 10 && IsWithin(currentFpscn, 10, 20))
            //            MainSettingsModel.Instance.TpsAdjust = 10;
            //        break;
            //}

            //if (TreeRoot.TicksPerSecond != (byte)MainSettingsModel.Instance.TpsAdjust)
            //{
            //    TreeRoot.TicksPerSecond = (byte)MainSettingsModel.Instance.TpsAdjust;
            //}

            //return true;
        }
예제 #32
0
 void Start()
 {
     manager = TherapistRegistrationButton.GetComponent<FormManager>();
 }
예제 #33
0
        public IHttpActionResult Get()
        {
            try
            {
                var request = Context.AuthenticatedRequest;

                var formInfo = FormManager.GetFormInfoByGet(request);
                if (formInfo == null)
                {
                    return(NotFound());
                }
                if (!request.IsAdminLoggin || !request.AdminPermissions.HasSitePermissions(formInfo.SiteId, FormUtils.PluginId))
                {
                    return(Unauthorized());
                }

                var     logId         = request.GetQueryInt("logId");
                var     fieldInfoList = FieldManager.GetFieldInfoList(formInfo.Id);
                LogInfo logInfo       = null;
                if (logId > 0)
                {
                    logInfo = LogManager.Repository.GetLogInfo(logId);
                }
                var list = new List <FieldInfo>();

                foreach (var fieldInfo in fieldInfoList)
                {
                    object value;
                    if (fieldInfo.FieldType == InputType.CheckBox.Value || fieldInfo.FieldType == InputType.SelectMultiple.Value)
                    {
                        value = logInfo != null
                            ? FormUtils.JsonDeserialize <List <string> >(logInfo.Get <string>(fieldInfo.Title))
                            : new List <string>();
                    }
                    //else if (fieldInfo.FieldType == InputType.Image.Value)
                    //{
                    //    value = logInfo != null
                    //        ? new List<string> {logInfo.Get<string>(fieldInfo.Title)}
                    //        : new List<string>();
                    //}
                    else if (fieldInfo.FieldType == InputType.Date.Value || fieldInfo.FieldType == InputType.DateTime.Value)
                    {
                        value = logInfo?.Get <DateTime>(fieldInfo.Title);
                    }
                    else
                    {
                        value = logInfo?.Get <string>(fieldInfo.Title);
                    }

                    if (value == null)
                    {
                        value = string.Empty;
                    }

                    list.Add(new FieldInfo
                    {
                        Id          = fieldInfo.Id,
                        Title       = fieldInfo.Title,
                        Description = fieldInfo.Description,
                        PlaceHolder = fieldInfo.PlaceHolder,
                        FieldType   = fieldInfo.FieldType,
                        Validate    = fieldInfo.Validate,
                        Columns     = fieldInfo.Columns,
                        Height      = fieldInfo.Height,
                        Items       = fieldInfo.Items,
                        Value       = value
                    });
                }

                var adminToken = Context.AdminApi.GetAccessToken(request.AdminId, request.AdminName, TimeSpan.FromDays(1));

                return(Ok(new
                {
                    Value = list,
                    AdminToken = adminToken
                }));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }