Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (Session["campaignid"] == null)
            {
                Response.Redirect("CampaignSelection.aspx");
            }
            Campaign           = CampaignSessionManager.GetCampaign((int)Session["campaignid"]);
            CampaignName.Value = Campaign.CampaignName;
            user = UserManager.GetUser(Session["username"].ToString());
            if (user.UserID == Campaign.DungeonMasterID)
            {
                IsCampaignDm.Value = "true";
            }
            else
            {
                UserID.Value = user.UserID.ToString();
            }
            //CampaignID.Text = Campaign.CampaignID.ToString();
            CharacterSheets = CampaignSessionManager.GetCharacterSheets(Campaign.CampaignID);
            var json = JsonConvert.SerializeObject(CharacterSheets);

            ClientScript.RegisterArrayDeclaration("dataList", json);
            ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "id", "start()", true);
        }
        protected void graphMissingImages(object sender, EventArgs e)
        {
            try {
                DateTime cacheExpiry = DateTime.Now.AddSeconds(15);
                lblGraphName.Text = "Missing Images by CrawlID";

                DataTable dt = Cache["dtMissingImageGraph"] as DataTable;
                if (dt == null)
                {
                    Cache.Insert("dtMissingImageGraph", Crawler.getGraphData("missingImages"), null, cacheExpiry, System.Web.Caching.Cache.NoSlidingExpiration);
                    dt = Cache["dtMissingImageGraph"] as DataTable;
                }
                foreach (DataRow dr in dt.Rows)
                {
                    ClientScript.RegisterArrayDeclaration("graphData", String.Format("{{y: '{0}', a: {1}}}", dr[0].ToString(), dr[1].ToString()));
                }

                Page.ClientScript.RegisterStartupScript(GetType(),
                                                        "myKey",
                                                        "Graph();",
                                                        true);
                graphPanel.Update();
            } catch (Exception ex) {
                // Exception handling for graphing fails
            }
        }
    /// <summary>
    /// post back of page is checked.all the active MVUserClassification from database are loaded into the memory
    /// and array consisting client ids of the elements is created..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title         = "Medical Vendor User Classification";
        errordiv.InnerText = "";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("MVUserClassification");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Master</a>";
        if (!IsPostBack)
        {
            ViewState["SortMVUserClassification"] = SortDirection.Ascending;
            if (Request.QueryString["searchtext"] != null)
            {
                SearchMVUserClassification(Request.QueryString["searchtext"].ToString());
            }
            else
            {
                GetMVUserClassification();
            }
        }

        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");
        ClientScript.RegisterArrayDeclaration("arrmvuserclassificationelemclientid", "'" + grdMVUserClassification.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrmvuserclassificationelemclientid", "'" + btnEdit.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrmvuserclassificationelemclientid", "'" + txtName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrmvuserclassificationelemclientid", "'" + txtDescription.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrmvuserclassificationelemclientid", "'" + hfMVUserClassificationID.ClientID + "'");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "Medical Vendor User";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("Medical Vendor User");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Other Management</a>";

        if (!IsPostBack)
        {
            ViewState["SortExp"] = "Name";
            ViewState["SortDir"] = SortDirection.Descending;

            if (Request.QueryString["Action"] != null)
            {
                ClientScript.RegisterStartupScript(typeof(string), "JSCode", "alert('Medical Vendor User(Physician)" + " " + Request.QueryString["Action"].ToString() + " " + "successfully.');", true);
            }


            if (Request.QueryString["searchtext"] != null)
            {
                SearchMedicalVendorUserData(Request.QueryString["searchtext"].ToString());
            }
            else
            {
                GetMedicalVendorUserData();
            }
        }

        ClientScript.RegisterArrayDeclaration("arrjscallcenterelementid", "'" + grdMVUser.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjscallcenterelementid", "'" + btnEdit.ClientID + "'");
    }
Beispiel #5
0
        // Refresh Button
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (cmbEmployee.SelectedValue.IsEmpty())
            {
                Response.Write("<script> alert('Please select a employee and enter year');</script>");
            }
            else
            {
                string        empID      = cmbEmployee.SelectedValue;
                SqlConnection connection = new SqlConnection(strcon);
                if (connection.State == ConnectionState.Closed)
                {
                    connection.Open();
                }
                SqlCommand cmd = new SqlCommand("SELECT Year,Month,NoOfDays FROM AttendanceByMonth WHERE EmpID=@empID", connection);
                cmd.Parameters.AddWithValue("@empID", empID);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        dataPoints.Add(new DataPoint(dr.GetInt32(0).ToString() + "/" + dr.GetInt32(1).ToString(), dr.GetInt32(2)));
                    }
                    ClientScript.RegisterArrayDeclaration("array", JsonConvert.SerializeObject(dataPoints));
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "graph()", true);
                }
                else
                {
                    Response.Write("<script> alert('There is no any record for selected employee!');</script>");
                }
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            master     = Page.Master as SiteMaster;
            user       = Request.QueryString["user"];
            playerPage = master.GetPlayer(user);

            setUp();

            ClientScript.RegisterArrayDeclaration("baseStats", currentCharacter.BaseStrength.ToString());
            ClientScript.RegisterArrayDeclaration("baseStats", currentCharacter.BaseDexterity.ToString());
            ClientScript.RegisterArrayDeclaration("baseStats", currentCharacter.BaseConstitution.ToString());
            ClientScript.RegisterArrayDeclaration("baseStats", currentCharacter.BaseIntelligence.ToString());
            ClientScript.RegisterArrayDeclaration("baseStats", currentCharacter.BaseWisdom.ToString());
            ClientScript.RegisterArrayDeclaration("baseStats", currentCharacter.BaseCharisma.ToString());

            ClientScript.RegisterArrayDeclaration("modifiedStats", (currentCharacter.BaseStrength + currentCharacter.StrengthModifier).ToString());
            ClientScript.RegisterArrayDeclaration("modifiedStats", (currentCharacter.BaseDexterity + currentCharacter.DexterityModifier).ToString());
            ClientScript.RegisterArrayDeclaration("modifiedStats", (currentCharacter.BaseConstitution + currentCharacter.ConstitutionModifier).ToString());
            ClientScript.RegisterArrayDeclaration("modifiedStats", (currentCharacter.BaseIntelligence + currentCharacter.IntelligenceModifier).ToString());
            ClientScript.RegisterArrayDeclaration("modifiedStats", (currentCharacter.BaseWisdom + currentCharacter.WisdomModifier).ToString());
            ClientScript.RegisterArrayDeclaration("modifiedStats", (currentCharacter.BaseCharisma + currentCharacter.CharismaModifier).ToString());

            ClientScript.RegisterArrayDeclaration("alignmentData", currentCharacter.GoodVals.ToString());
            ClientScript.RegisterArrayDeclaration("alignmentData", currentCharacter.ChaoticVals.ToString());
            ClientScript.RegisterArrayDeclaration("alignmentData", currentCharacter.EvilVals.ToString());
            ClientScript.RegisterArrayDeclaration("alignmentData", currentCharacter.LawfulVals.ToString());

            ClientScript.RegisterStartupScript(Page.GetType(), "OnLoad", "loadChart();", true);
        }
Beispiel #7
0
    /// <summary>
    /// post back of page is checked.all the active hosttype from database are loaded into the memory
    /// and array consisting client ids of the elements is created..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title            = "Host Type";
        divErrorMsg.InnerText = "";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("HostType");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Master</a>";
        if (!IsPostBack)
        {
            ViewState["SortHostType"] = SortDirection.Ascending;
            if (Request.QueryString["searchtext"] != null)
            {
                SearchHostType(Request.QueryString["searchtext"].ToString());
            }
            else
            {
                GetHostType();
            }
        }

        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");
        ClientScript.RegisterArrayDeclaration("arrhosttypeelemclientid", "'" + grdHostType.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrhosttypeelemclientid", "'" + btnEdit.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrhosttypeelemclientid", "'" + txtName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrhosttypeelemclientid", "'" + txtDescription.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrhosttypeelemclientid", "'" + hfHostTypeID.ClientID + "'");
    }
Beispiel #8
0
    /// <summary>
    /// post back of page is checked.all the active countries from database are loaded into the memory
    /// and array consisting client ids of the elements is created..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title            = "Country";
        divErrorMsg.InnerText = "";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("Country");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Master</a>";
        if (!IsPostBack)
        {
            ViewState["SortCountry"] = SortDirection.Ascending;
            if (Request.QueryString["searchtext"] != null)
            {
                SearchCountry(Request.QueryString["searchtext"].ToString());
            }
            else
            {
                GetCountry();
            }
        }
        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");

        //ClientScript.RegisterArrayDeclaration("arrvalidations", "'" + CountryRequiredValidator.ClientID + "'");
        //ClientScript.RegisterArrayDeclaration("arrvalidations", "'" + CountrySpecialValidator.ClientID + "'");
        //ClientScript.RegisterArrayDeclaration("arrvalidations", "'" + ErrorSummary.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcountryelemclientid", "'" + grdCountry.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcountryelemclientid", "'" + btnEdit.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcountryelemclientid", "'" + txtName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcountryelemclientid", "'" + txtDescription.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcountryelemclientid", "'" + hfCountryID.ClientID + "'");
    }
Beispiel #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title            = "Item";
        divErrorMsg.InnerText = "";
        var obj = (Franchisor_FranchisorMaster)this.Master;

        obj.settitle("Item");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Master</a>";
        if (!IsPostBack)
        {
            ViewState["SortItem"] = SortDirection.Ascending;
            if (Request.QueryString["searchtext"] != null)
            {
                SearchItems(Request.QueryString["searchtext"]);
            }
            else
            {
                GetAllItems();
            }
            GetAllActiveInventory();
        }
        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + grdItem.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + txtItemCode.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + txtSKUCode.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + txtManfName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + txtManfID.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + ddlInventory.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + btnEdit.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + hfItemID.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrjsitemselements", "'" + txtNote.ClientID + "'");
    }
        protected override void OnLoad(EventArgs e)
        {
            Assert.ArgumentNotNull(e, "e");
            if (!CheckSecurity())
            {
                return;
            }
            ClientScript.RegisterArrayDeclaration("dictionary", "'NOT_XML_FILE'");
            base.OnLoad(e);
            if (!IsPostBack || FileInput.PostedFile == null)
            {
                return;
            }
            string fileName = FileInput.PostedFile.FileName;

            if (string.IsNullOrEmpty(fileName) || !string.IsNullOrEmpty(LastFile.Value) && LastFile.Value.Equals(fileName))
            {
                return;
            }
            if (!string.IsNullOrEmpty(LastFile.Value))
            {
                try
                {
                    FileUtil.Delete(FileUtil.MapPath("/temp/" + FileUtil.GetFileName(LastFile.Value)));
                }
                catch
                {
                }
            }
            LastFile.Value = fileName;
            FileInput.PostedFile.SaveAs(FileUtil.MapPath("/temp/" + FileUtil.GetFileName(fileName)));
        }
Beispiel #11
0
    private void GetDropDownInfo()
    {
        List <EState> state;

        if (!IsPostBack)
        {
            MasterDAL  masterDal = new MasterDAL();
            ECountry[] country   = masterDal.GetCountry(string.Empty, 3).ToArray();

            if (country.Length > 0)
            {
                ViewState["CountryID"] = country[0].CountryID.ToString();
                ddlcountry.Items.Insert(0, new ListItem("Select Country", "0"));
                for (int count = 0; count < country.Length; count++)
                {
                    ddlcountry.Items.Add(new ListItem(country[count].Name, country[count].CountryID.ToString()));
                }
            }
            else
            {
                ddlcountry.Items.Add("Select");
            }

            state = masterDal.GetState(string.Empty, 3);

            ViewState["state"] = state;
            ddlMState.Items.Clear();
            ddlMState.Items.Add(new ListItem("Select State", "0"));
            for (int icount = 0; icount < state.Count; icount++)
            {
                ddlMState.Items.Add(new ListItem(state[icount].Name, state[icount].StateID.ToString()));
            }
        }
        else
        {
            state = (List <EState>)ViewState["state"];
        }

        ddlcountry.Attributes["onChange"] = "oncountrychange('" + ddlcountry.ClientID + "','" + ddlstate.ClientID + "' , false);";

        if (state.Count > 0)
        {
            for (int count = 0; count < state.Count; count++)
            {
                ClientScript.RegisterArrayDeclaration("arrjsstatenames", "'" + state[count].Name + "'");
                ClientScript.RegisterArrayDeclaration("arrjsstateids", "'" + state[count].StateID.ToString() + "'");
                ClientScript.RegisterArrayDeclaration("arrjsstatecntryids", "'" + state[count].StateID.ToString() + "-" + state[count].Country.CountryID + "'");
            }
        }
        else
        {
            ddlstate.Items.Add("Select");
        }
    }
        private void Page_PreRender(object sender, System.EventArgs e)
        {
            ClientScript.RegisterArrayDeclaration("OsPage_Validators", "{}");

            NegotiateTabIndexes();

            foreach (Control child in this.Controls)
            {
                DisableViewState(child);
            }
        }
Beispiel #13
0
    /// <summary>
    /// This function accepts the webcontrol as parameter which indicates if the control
    /// has any chnge in value the user will get prompt to confirm while trying to
    /// navigate away from this page
    /// </summary>
    /// <param name="wc"></param>
    ///
    public void MonitorChangesWithPostBack(WebControl wc, string value)
    {
        if (wc == null)
        {
            return;
        }

        /* In side the following if-else block the controls that needs confirmation
         * is assigned to the array which will later be used by the script */
        if (wc is CheckBoxList || wc is RadioButtonList)
        {
            for (int i = 0; i <= ((ListControl)(wc)).Items.Count - 1; i++)
            {
                ListControl li = (ListControl)(wc);
                ClientScript.RegisterArrayDeclaration("monitorChangesIDs", "\"" + string.Concat(wc.ClientID, "_", i) + "\"");
                ClientScript.RegisterArrayDeclaration("monitorChangesValues", li.Items[i].Selected.ToString().ToLower());
            }
        }
        else if (wc is ListBox)
        {
            ListBox list         = (ListBox)(wc);
            string  selectedItem = string.Empty;
            for (int i = 0; i < list.Items.Count; i++)
            {
                if (list.Items[i].Selected)
                {
                    if (selectedItem == string.Empty)
                    {
                        selectedItem = list.Items[i].Value;
                    }
                    else
                    {
                        selectedItem = selectedItem + ":" + list.Items[i].Value;
                    }
                }
            }
            ClientScript.RegisterArrayDeclaration("monitorChangesIDs", "\"" + wc.ClientID + "\"");
            ClientScript.RegisterArrayDeclaration("monitorChangesValues", "\"" + selectedItem + "\"");
        }
        else
        {
            ClientScript.RegisterArrayDeclaration("monitorChangesIDs", "\"" + wc.ClientID + "\"");
            if (value.ToLower() != "true" && value.ToLower() != "false")
            {
                ClientScript.RegisterArrayDeclaration("monitorChangesValues", (value == "" || value == null) ? "''" : "'" + value.Replace("'", "&#39;").Replace("\\", "&#47;").Replace("\n", "&|b").Replace("\r", "&#b").Replace("/", "~!@=|") + "'");
            }
            else
            {
                ClientScript.RegisterArrayDeclaration("monitorChangesValues", (value == "" || value == null) ? "''" : value.ToLower());
            }
        }
        AssignMonitorChangeValuesOnPageLoadWithPostBack();
    }
Beispiel #14
0
    /// <summary>
    /// post back of page is checked.all the active cities from database are loaded into the memory
    /// and array consisting client ids of the elements is created..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "City";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("City");
        obj.SetBreadCrumbRoot         = "<a href=\"#\">Master</a>";
        btnSave.Attributes["onClick"] = "return savecity();";
        txtMZipCode.Attributes.Add("onKeyDown", "return txtkeypress(event);");

        GetDropDownInfo();
        if (!IsPostBack)
        {
            ViewState["SortExp"] = "name";
            ViewState["SortDir"] = SortDirection.Ascending;
            if (Request.QueryString["searchtext"] != null)
            {
                SearchCity(Request.QueryString["searchtext"].ToString());
            }
            else
            {
                GetCity();
            }
        }
        else
        {
            if (Request.Params != null)
            {
                if (Request.Params.Count > 0)
                {
                    ViewState["stateid"] = 0;
                    if (Request.Params["__EVENTTARGET"].ToString().Equals("save"))
                    {
                        ViewState["stateid"] = Request.Params["__EVENTARGUMENT"].ToString();
                        UpdateCity();
                    }
                }
            }
        }

        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + grdCity.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + txtName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + txtDescription.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + ddlcountry.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + ddlstate.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + btnEdit.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + hfCityID.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrelemjscity", "'" + txtZip.ClientID + "'");

        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");
        //hfZipFlag.Value = "";
    }
    protected void RadReplay_Click(object sender, EventArgs e)
    {
        int[] arr;
        int   carrierId = 0;

        arr       = car_listbox.GetSelectedIndices();
        carrierId = Int32.Parse(car_listbox.Items[arr[0]].Value);
        double[] latitude = new double[2];
        latitude[0] = 22.2;
        ClientScript.RegisterArrayDeclaration("latitudeArr", "'22.0'");
        Page.ClientScript.RegisterStartupScript(Page.GetType(), "MyKey", "placeMarker('" + 20 + "', '" + latitude + "', '" + 74.0 + "', '" + 50 + "', '" + 15 + "');", true);
    }
Beispiel #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();

        if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
        {
            Response.Redirect("../unauthorizedaccess.aspx");
        }
        PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Bid Event Details");
        connstring          = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());

        Session[Constant.SESSION_COMMENT_TYPE] = "0";

        if (Request.QueryString["brn"] != null)
        {
            Session[Constant.SESSION_BIDREFNO] = Request.QueryString["brn"].ToString();
        }

        if (Session[Constant.SESSION_BIDREFNO] == null)
        {
            Response.Redirect("approvedbiditems.aspx");
        }

        if (gvSuppliers.Rows.Count > 0)
        {
            CheckBox chkHeader = (CheckBox)gvSuppliers.HeaderRow.FindControl("chkHeader");
            chkHeader.Attributes["onclick"] = "ChangeAllCheckBoxStates(this.checked);";
            ClientScript.RegisterArrayDeclaration("CheckBoxIDs", String.Concat("'", chkHeader.ClientID, "'"));

            foreach (GridViewRow gr in gvSuppliers.Rows)
            {
                CheckBox chkRow = (CheckBox)gr.FindControl("chkRow");
                chkRow.Attributes["onclick"] = "ChangeHeaderAsNeeded();";
                ClientScript.RegisterArrayDeclaration("CheckBoxIDs", String.Concat("'", chkRow.ClientID, "'"));
            }
        }

        if (!Page.IsPostBack)
        {
            if (Session["Message"] != null)
            {
                lblMessage.Text    = Session["Message"].ToString();
                Session["Message"] = null;
            }

            if (DateTime.Now >= Convert.ToDateTime(((Label)((DetailsView)Biddetails_details1.FindControl("dvEventDetails")).Rows[12].Cells[1].FindControl("lblDeadline")).Text))
            {
                btnSendEmailToVendors.Visible  = false;
                gvSuppliers.Columns[0].Visible = false;
            }
        }
    }
    /// <summary>
    /// post back of page is checked.all the active contract from database are loaded into the memory
    /// and array consisting client ids of the elements is created..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "Contract";

        divErrorMsg.InnerText = "";
        var obj = (Franchisor_FranchisorMaster)Master;

        obj.settitle("Contract");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Master</a>";

        if (!IsPostBack)
        {
            var stateRepository = IoC.Resolve <IStateRepository>();
            var states          = stateRepository.GetAllStates();

            var fillState = new Func <DropDownList, DropDownList>(ddl =>
            {
                ddl.Items.Clear();

                ddl.DataSource     = states;
                ddl.DataTextField  = "Name";
                ddl.DataValueField = "Id";
                ddl.DataBind();

                ddl.Items.Insert(0, new ListItem("Select State", "0"));
                return(ddl);
            });

            ddlstate = fillState(ddlstate);

            ViewState["StateSort"]    = SortDirection.Ascending;
            ViewState["ContractSort"] = SortDirection.Ascending;
            ViewState["SortExp"]      = "name";
            if (Request.QueryString["searchtext"] != null)
            {
                SearchContract(Request.QueryString["searchtext"]);
            }
            else
            {
                GetContract();
            }
        }
        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");
        ClientScript.RegisterArrayDeclaration("arrcontractelemclientid", "'" + grdContract.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcontractelemclientid", "'" + txtName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcontractelemclientid", "'" + txtDescription.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcontractelemclientid", "'" + ddlstate.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcontractelemclientid", "'" + hfContractID.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrcontractelemclientid", "'" + txtContract.ClientID + "'");
    }
Beispiel #18
0
    /// <summary>
    /// post back of page is checked.all the active script from database are loaded into the memory
    /// and array consisting client ids of the elements is created..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title         = "Script";
        errordiv.InnerText = "";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("Script");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Master</a>";
        if (!IsPostBack)
        {
            CallCenterDAL      callCenterDal = new CallCenterDAL();
            List <EScriptType> scriptTypes   = callCenterDal.GetScriptType(string.Empty, 3);
            List <EScript>     scripts       = callCenterDal.GetScript(string.Empty, 3);

            if (scriptTypes.Count > 0)
            {
                ddlscripttype.Items.Add(new ListItem("Select Script Type", "0"));
                for (int count = 0; count < scriptTypes.Count; count++)
                {
                    ddlscripttype.Items.Add(new ListItem(scriptTypes[count].ScriptName, scriptTypes[count].ScriptTypeID.ToString()));
                }
            }
            else
            {
                ddlscripttype.Items.Add("Select");
            }

            ViewState["SortDir"] = SortDirection.Ascending;
            ViewState["SortExp"] = "name";
            if (Request.QueryString["searchtext"] != null)
            {
                SearchScript(Request.QueryString["searchtext"]);
            }
            else
            {
                GetScript();
            }
        }
        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + grdScript.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + btnEdit.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + txtName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + txtDescription.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + ddlscripttype.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + hfScriptID.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + chkIsDefault.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrscriptelemclientid", "'" + txtScriptText.ClientID + "'");
    }
Beispiel #19
0
        private void fillVectors()
        {
            //AttackVector A = new AttackVector(1, 1, 1);
            //AttackVector B = new AttackVector(2, 3, 1);
            //AttackVector C = new AttackVector(2, 1, 2);
            AttackVector        newAttack = new AttackVector((int)aDropList.SelectedIndex, (int)rDropList.SelectedIndex, (int)tDropList.SelectedIndex);
            List <AttackVector> attacks   = new List <AttackVector> {
                newAttack
            };

            foreach (AttackVector X in attacks)
            {
                ClientScript.RegisterArrayDeclaration("input", JsonConvert.SerializeObject(X));
            }
        }
Beispiel #20
0
    protected void gvUserList_DataBound(object sender, EventArgs e)
    {
        if (gvUserList.HeaderRow != null)
        {
            CheckBox cb = (CheckBox)gvUserList.HeaderRow.FindControl("HeaderLevelCheckBox");
            cb.Attributes["onclick"] = "ChangeAllCheckBoxStates(this.checked);";
            ClientScript.RegisterArrayDeclaration("CheckBoxIDs", String.Concat("'", cb.ClientID, "'"));
            foreach (GridViewRow gvr in gvUserList.Rows)
            {
                CheckBox cbb = (CheckBox)gvr.FindControl("RowLevelCheckBox");
                cbb.Attributes["onclick"] = "ChangeHeaderAsNeeded();";

                ClientScript.RegisterArrayDeclaration("CheckBoxIDs", String.Concat("'", cbb.ClientID, "'"));
            }
        }
    }
Beispiel #21
0
    /// <summary>
    /// post back of page is checked.all the active State from database are loaded into the memory
    /// and array consisting client ids of the elements is created..
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title         = "State";
        errordiv.InnerHtml = "";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("State");
        obj.SetBreadCrumbRoot = "<a href=\"#\">Master</a>";
        if (!IsPostBack)
        {
            var masterDAL = new MasterDAL();
            var country   = masterDAL.GetCountry(string.Empty, 3).ToArray();

            ddlcountry.Items.Clear();

            if (country.Length > 0)
            {
                ddlcountry.Items.Insert(0, new ListItem("Select Country", "0"));
                for (int count = 0; count < country.Length; count++)
                {
                    ddlcountry.Items.Add(new ListItem(country[count].Name, country[count].CountryID.ToString()));
                }
            }

            ViewState["CountrySort"] = SortDirection.Ascending;
            ViewState["StateSort"]   = SortDirection.Ascending;
            ViewState["SortExp"]     = "name";
            if (Request.QueryString["searchtext"] != null)
            {
                SearchState(Request.QueryString["searchtext"].ToString());
            }
            else
            {
                GetState();
            }
        }
        Panel1.Style.Add(HtmlTextWriterStyle.Display, "none");
        ClientScript.RegisterArrayDeclaration("arrstateelemclientid", "'" + grdState.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrstateelemclientid", "'" + btnEdit.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrstateelemclientid", "'" + txtName.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrstateelemclientid", "'" + txtDescription.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrstateelemclientid", "'" + ddlcountry.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrstateelemclientid", "'" + hfStateID.ClientID + "'");
        ClientScript.RegisterArrayDeclaration("arrstateelemclientid", "'" + txtStateCode.ClientID + "'");
        grdState.Columns[2].Visible = false;
    }
    private void SetSearchParameters()
    {
        if (providerList.Visible)
        {
            providerList.ClinicTypeId = new Guid(ClinicTypeList.SelectedValue);
            providerList.Keywords     = Keywords.Text;

            Double miles = 0d;
            if (Double.TryParse(Miles.Text, out miles))
            {
                providerList.WithinMiles = miles;
                providerList.ZipCode     = ZipCode.Text;
            }

            // For the map control
            ClientScript.RegisterArrayDeclaration("providerSearchValues", String.Format("'{0}','{1}','{2}','{3}'", ClinicTypeList.SelectedValue, Keywords.Text, Miles.Text, ZipCode.Text));
        }
    }
Beispiel #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            CampaignList = CampaignManager.GetCharacterCampaigns(Session["username"].ToString());
            var json = JsonConvert.SerializeObject(CampaignList);

            ClientScript.RegisterArrayDeclaration("dataList", json);

            var invitelist =
                InvitationManager.GetAllInvitations(UserManager.GetUser(Session["username"].ToString()).UserID);
            var json2 = JsonConvert.SerializeObject(invitelist);

            ClientScript.RegisterArrayDeclaration("invitationList", json2);

            ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "id", "start()", true);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "Medical Vendor User";
        errordiv.InnerHtml = "";
        MedicalVendor_MedicalVendorMaster obj = (MedicalVendor_MedicalVendorMaster)this.Master;
        obj.SetBreadCrumbRoot = "<a href=\"#\">Vendors</a>";
        if (!IsPostBack)
        {
            Ucupdatephotopanel1.TeamImageVisible = false;
            FillTest();
            GetDropDownInfo();
            this.FillMvUserData();


        }
        ClientScript.RegisterArrayDeclaration("jselemshiddenfields", "'" + hfcityid.ClientID.ToString() + "'");
        ClientScript.RegisterArrayDeclaration("jselemshiddenfields", "'" + hfstateid.ClientID.ToString() + "'");

    }
Beispiel #25
0
        private void RegisterArrayInClientSide()
        {
            dataPoints1 = SortingByMonth(dataPoints1);
            dataPoints2 = SortingByMonth(dataPoints2);
            dataPoints3 = SortingByMonth(dataPoints3);
            dataPoints4 = SortingByMonth(dataPoints4);
            dataPoints5 = SortingByMonth(dataPoints5);
            dataPoints6 = SortingByMonth(dataPoints6);
            dataPoints7 = SortingByMonth(dataPoints7);


            ClientScript.RegisterArrayDeclaration("array1", JsonConvert.SerializeObject(dataPoints1));
            ClientScript.RegisterArrayDeclaration("array2", JsonConvert.SerializeObject(dataPoints2));
            ClientScript.RegisterArrayDeclaration("array3", JsonConvert.SerializeObject(dataPoints3));
            ClientScript.RegisterArrayDeclaration("array4", JsonConvert.SerializeObject(dataPoints4));
            ClientScript.RegisterArrayDeclaration("array5", JsonConvert.SerializeObject(dataPoints5));
            ClientScript.RegisterArrayDeclaration("array6", JsonConvert.SerializeObject(dataPoints6));
            ClientScript.RegisterArrayDeclaration("array7", JsonConvert.SerializeObject(dataPoints7));

            Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "graph()", true);
        }
        private void SetClientCheckBoxIds()
        {
            try
            {
                if (permissionGridView.Rows.Count == 0)
                {
                    return;
                }

                foreach (GridViewRow row in permissionGridView.Rows)
                {
                    CheckBox chk = (CheckBox)row.FindControl("accessableCheckBox");
                    if (chk == null)
                    {
                        continue;
                    }
                    ClientScript.RegisterArrayDeclaration("CheckBoxIDs", String.Concat("'", chk.ClientID, "'"));
                }
            }
            catch (Exception ex)
            {
            }
        }
    /// <summary>
    /// Hosated In Past Text Dropdown.
    /// </summary>
    private void HostedInPastList()
    {
        XmlTextReader reader = new XmlTextReader(Server.MapPath("HostedInPast.Xml"));

        reader.WhitespaceHandling = WhitespaceHandling.None;
        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.Load(reader);
        XmlNodeList _names = xmlDoc.GetElementsByTagName("Name");

        for (int i = 0; i < _names.Count; i++)
        {
            if (_names[i].InnerText != null && _names[i].InnerText != "")
            {
                ClientScript.RegisterArrayDeclaration("HostedInPastWith", "'" + _names[i].InnerText + "'");
            }
        }
        reader.Close();;
        StringBuilder sb = new StringBuilder();

        sb.Append(" var obj = actb(document.getElementById('" + txtHostedInPast.ClientID + "'), HostedInPastWith);");
        ClientScript.RegisterStartupScript(typeof(string), "jscodeHostedInPast", sb.ToString(), true);
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
     Response.Cache.SetNoStore();
     if (Session.Count == 0)
     {
         Response.Redirect("Home.aspx");
     }
     else
     {
         BalBooking2 bal = new BalBooking2();
         bus               = (BeBooking)Session["bus"];
         userid.Value      = bus.uid.ToString();
         uname.Value       = bal.GetUser(bus);
         start.Value       = bus.start;
         destination.Value = bus.destination;
         time.Value        = bus.time.ToLongTimeString().Substring(0, 8);
         busname.Value     = bus.bus_name;
         date.Value        = bus.dte.Date.ToString().Substring(0, 9);
         cost              = bus.cost;
         ClientScript.RegisterArrayDeclaration("cost", "'" + cost + "'");
     }
 }
Beispiel #29
0
    /// <summary>
    /// This function accepts the webcontrol as parameter which indicates if the control
    /// has any chnge in value the user will get prompt to confirm while trying to
    /// navigate away from this page
    /// </summary>
    /// <param name="wc"></param>
    ///
    public void MonitorChanges(WebControl wc)
    {
        if (wc == null)
        {
            return;
        }

        /* In side the following if-else block the controls that needs confirmation
         * is assigned to the array which will later be used by the script */
        if (wc is CheckBoxList || wc is RadioButtonList)
        {
            for (int i = 0; i <= ((ListControl)(wc)).Items.Count - 1; i++)
            {
                ClientScript.RegisterArrayDeclaration("monitorChangesIDs", "\"" + string.Concat(wc.ClientID, "_", i) + "\"");
                ClientScript.RegisterArrayDeclaration("monitorChangesValues", "null");
            }
        }
        else
        {
            ClientScript.RegisterArrayDeclaration("monitorChangesIDs", "\"" + wc.ClientID + "\"");
            ClientScript.RegisterArrayDeclaration("monitorChangesValues", "null");
        }
        AssignMonitorChangeValuesOnPageLoad();
    }
Beispiel #30
0
    protected void Button4_Click(object sender, EventArgs e)
    {
        // Response.Write(marker_place);
        List <string> lst_zipscodes = new List <string>();
        IGeocoder     geocoder      = new GoogleGeocoder()
        {
        };
        DataSet       ds = new DataSet("Sites_Collection");
        string        connection_string = ConfigurationManager.ConnectionStrings["UA_NAVConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(connection_string);

        WeatherReference.WeatherSoapClient weather = new WeatherReference.WeatherSoapClient("WeatherSoap");


        // my source starting placeplace

        for (int i = 0; i < marker_place.Count; i++)
        {
            string   source      = marker_place[i];
            string[] addr_string = source.Split(',');
            string[] zipcode     = null;
            if (addr_string.Count() == 4)
            {
                zipcode = addr_string[2].Trim().Split(' ');
                source  = addr_string[1] + "," + zipcode[0];
                lst_zipscodes.Add(zipcode[1]);
            }
            else
            {
                continue;
            }
            IWebDriver driver = null;
            try
            {
                driver = new FirefoxDriver();

                driver.Navigate().GoToUrl("http://www.nwf.org/naturefind.aspx");
                driver.Manage().Window.Maximize();

                var place_name = driver.FindElement(By.Id("content_0_txtBasicSearch"));
                place_name.Clear();
                place_name.SendKeys(source);
                driver.FindElement(By.Id("content_0_btnSearchSites")).Click();
                //driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));

                IWait <IWebDriver> wait = new OpenQA.Selenium.Support.UI.WebDriverWait(driver, TimeSpan.FromSeconds(15.00));
                // IWait<IWebDriver> wait = null;
                wait.Until(driver1 => ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState").Equals("complete"));


                DataTable dt = new DataTable("Places_" + i);

                DataColumn place_Coulumn    = new DataColumn("Scenic_Place_Name", Type.GetType("System.String"));
                DataColumn lat_Coulumn      = new DataColumn("Latitude", Type.GetType("System.String"));
                DataColumn lng_Coulumn      = new DataColumn("Longitude", Type.GetType("System.String"));
                DataColumn address_of_place = new DataColumn("Address", Type.GetType("System.String"));
                DataColumn Zipscode         = new DataColumn("Zipcode", Type.GetType("System.String"));
                DataColumn weather_desc     = new DataColumn("Weather", Type.GetType("System.String"));
                DataColumn temperature      = new DataColumn("Temperature", Type.GetType("System.String"));
                DataColumn traffic          = new DataColumn("Traffic", Type.GetType("System.String"));
                DataColumn safety           = new DataColumn("Safety", Type.GetType("System.String"));
                dt.Columns.Add(place_Coulumn);
                dt.Columns.Add(lat_Coulumn);
                dt.Columns.Add(lng_Coulumn);
                dt.Columns.Add(address_of_place);
                dt.Columns.Add(Zipscode);
                dt.Columns.Add(weather_desc);
                dt.Columns.Add(temperature);
                dt.Columns.Add(traffic);
                dt.Columns.Add(safety);

                DataRow dr;
                int     count1 = 0;

                try
                {
                    wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@id='content_0_grdSiteList']//tr[@class='rgRow']//u")));
                    wait.Until(ExpectedConditions.ElementExists(By.XPath("//div[@id='content_0_grdSiteList']//tr[@class='rgRow']//u")));
                    IList <IWebElement> lst_places = driver.FindElements(By.XPath(".//div[@id='content_0_grdSiteList']//tr[@class='rgRow']//u"));

                    if (lst_places == null)
                    {
                        continue;
                    }
                    int count = 0;
                    foreach (IWebElement place in lst_places)
                    {
                        //   if (count1!= -1)
                        //    {
                        try
                        {
                            dr = dt.NewRow();
                            Thread.Sleep(200);
                            dr["Scenic_Place_Name"] = place.Text;
                            IEnumerable <Address> addresses = geocoder.Geocode(place.Text + "," + zipcode[0]);
                            string   place_addr             = null;
                            Location ltng = null;

                            foreach (Address adr in addresses)
                            {
                                if (count == 0)
                                {
                                    place_addr    = adr.FormattedAddress;
                                    ltng          = adr.Coordinates;
                                    dr["Address"] = place_addr;
                                    break;
                                }
                            }

                            dr["Latitude"]  = ltng.Latitude;
                            dr["Longitude"] = ltng.Longitude;

                            //tokenize place address

                            string[] array         = place_addr.Split(',');
                            string[] waypoints     = place_addr.Split(','); ///////*******************
                            string   zip           = array[array.Length - 2];
                            string[] arr           = zip.Trim().Split(' ');
                            string   webservicezip = null;
                            if (arr.Length == 1)
                            {
                                dr["Zipcode"] = zipcode[1];
                                webservicezip = zipcode[1];
                            }
                            else if (Regex.IsMatch(place_addr, @"\d"))
                            {
                                arr           = zip.Trim().Split(' ');
                                dr["Zipcode"] = arr[1].Trim();
                                webservicezip = arr[1].Trim();
                            }

                            //weather update

                            WeatherReference.WeatherReturn weather_of_place = weather.GetCityWeatherByZIP(webservicezip);  //  arr[1].Trim()
                            dr["Weather"]     = weather_of_place.Description;
                            dr["Temperature"] = weather_of_place.Temperature;

                            Random rnd = new Random();
                            dr["Traffic"] = rnd.Next(2, 5);
                            dr["Safety"]  = rnd.Next(60, 100);
                            dt.Rows.Add(dr);
                            //break;
                        }

                        catch (Exception ex)
                        {
                            Console.WriteLine(ex);
                            continue;
                        }
                    }
                }
                finally
                {
                    ds.Tables.Add(dt);
                }
            }

            finally
            {
                driver.Close();
                driver.Dispose();
            }
        }

        WriteDataToDATABASE(ds);
        string[] scenic_places = CreateListScenicPlaces();
        //    DrawScenicDirection();
        foreach (string s in scenic_places)
        {
            ClientScript.RegisterArrayDeclaration("scenic_places", "\"" + s + "\"");
        }

        ClientScript.RegisterStartupScript(Page.GetType(), "Scenic", "scenic_route();", true);
    }