protected void btn_release_Click(object sender, EventArgs e)
        {
            int facility_id = Convert.ToInt32((sender as LinkButton).CommandArgument);

            FacilityDS.FacilityDSDataTable dt = BllProxyFacility.SelectFacility(facility_id);
            if (dt.Rows.Count == 0 || agent_id != dt[0].agent_id)
            {
                showErrorMessage("Failed to release facility");
                return;
            }

            BllProxyFacility.SetCommand(facility_id, 0, null);
        }
Пример #2
0
        protected bool checkKioskOpen()
        {
            bool result = false;

            FacilityDS.FacilityDSDataTable dt = BllProxyFacility.SelectFacility(this.FacilityId);
            if (dt.Rows.Count != 0)
            {
                result = dt[0].active;
            }
            return(result);

            //if (DateTime.Now.Second < 50)
            //    return true;
            //else
            //    return false;
        }
Пример #3
0
        protected void setFacility(Int32 _facilityId)
        {
            this.clearMessage();

            FacilityDS.FacilityDSDataTable dt = BllProxyFacility.SelectFacility(_facilityId);

            if (dt.Rows.Count > 0)
            {
                lblFacilityName.Text = dt[0].facility_name;

                setFacilityGroups(_facilityId);
            }
            else
            {
                lblFacilityName.Text = "ERROR: " + _facilityId.ToString();
            }
        }
Пример #4
0
        public void Start()
        {
            string script = "window.resizeTo( 550, 440 )";

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SetSurveyScreenSize", script, true);

            Int32 surveyId = 0;

            startTime = DateTime.Now;


            FacilityDS.FacilityDSDataTable dtF = BllProxyFacility.SelectFacility(this.FacilityId);
            if (dtF.Rows.Count > 0)
            {
                if (!dtF[0].Issurvey_idNull())
                {
                    surveyId = dtF[0].survey_id;
                }
            }

            if (surveyId != 0)
            {
                QuestionDS.QuestionDSDataTable dt = BllProxyQuestion.GetQuestionsBySurvey(surveyId);
                rptSurveyQuestions.DataSource = dt;

                if (dt.Rows.Count != 0)
                {
                    rptSurveyQuestions.DataBind();
                }
                else
                {
                    UcControlArgs args = new UcControlArgs();
                    goNext(args);
                }
            }
            else
            {
                UcControlArgs args = new UcControlArgs();
                goNext(args);
            }
        }
        int SetCommand(object sender, string command, string error)
        {
            int facility_id = Convert.ToInt32((sender as LinkButton).CommandArgument);

            FacilityDS.FacilityDSDataTable dt = BllProxyFacility.SelectFacility(facility_id);
            if (dt.Rows.Count == 0)
            {
                showErrorMessage(error);
                return(0);
            }

            int id = dt[0].agent_id;

            if (id != 0 && id != agent_id)
            {
                showErrorMessage(error);
                return(0);
            }

            BllProxyFacility.SetCommand(facility_id, agent_id, command);
            return(facility_id);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack)
            {
                return;
            }

            uctx_cab = System.Configuration.ConfigurationManager.AppSettings["uctx.cab"];

            string fid = Request["id"];

            int.TryParse(fid, out facility_id);

            if (Request["release"] != null)
            {
                BllProxyFacility.SetCommand(facility_id, 0, null);
                Response.Redirect("../close.htm");
                return;
            }

            int agent_id = ProxyHelper.GetUserAgentId(this.UserId);

            FacilityDS.FacilityDSDataTable dt = BllProxyFacility.SelectFacility(facility_id);
            if (dt.Rows.Count == 0)
            {
                error = "Failed to view facility screen";
                return;
            }

            FacilityDS.FacilityDSRow row = dt[0];

            int id = row.agent_id;

            if (id != 0 && id != agent_id)
            {
                error = "Failed to view facility screen";
                return;
            }

            name = row.facility_name;

            settings[1] = fid;

            string server = ProxyHelper.GetSettingValueString("Server", "CTX_SERVER");

            if (string.IsNullOrEmpty(server))
            {
                error = "Configuration failed";
                return;
            }

            string[] ss = server.Split(':');
            if (ss.Length != 4)
            {
                error = "Configuration failed";
                return;
            }

            settings[3] = ss[0];
            settings[5] = ss[1];
            settings[7] = ss[2];
            settings[9] = ss[3];

            BllProxyFacility.SetCommand(facility_id, agent_id, "rscr\n" + server);
        }
Пример #7
0
        protected void btnFinish_Click(object sender, EventArgs e)
        {
            Int32 surveyId = 0;

            FacilityDS.FacilityDSDataTable dtF = BllProxyFacility.SelectFacility(this.FacilityId);
            if (dtF.Rows.Count > 0)
            {
                surveyId = dtF[0].survey_id;
            }



            bool isComplete = false;

            foreach (Control c in rptSurveyQuestions.Items)
            {
                UcKioskSurveyQuestion surveyQuestion = (UcKioskSurveyQuestion)c.FindControl("SurveyQuestion");

                if (surveyQuestion != null)
                {
                    if (surveyQuestion.SurveyResponse != "")
                    {
                        isComplete = true;
                    }
                }
            }



            if (isComplete)
            {
                foreach (Control c in rptSurveyQuestions.Items)
                {
                    UcKioskSurveyQuestion surveyQuestion = (UcKioskSurveyQuestion)c.FindControl("SurveyQuestion");

                    if (surveyQuestion != null)
                    {
                        Int32  questionId = surveyQuestion.QuestionId;
                        Int32  typeId     = surveyQuestion.QuestionType;
                        string response   = surveyQuestion.SurveyResponse;


                        //if ((typeId == 2)||(typeId == 3))
                        if (response == "")
                        {
                            response = null;
                        }


                        if (response != "")
                        {
                            BllProxySurvey.InsertSurveyResponse(incidentId, surveyId, questionId, response);
                        }
                    }
                }
            }

            UcControlArgs args = new UcControlArgs();

            goNext(args);
        }