Пример #1
0
    protected void BtnAddskill_Click(object sender, EventArgs e)
    {
        if (ListBoxSkills.Items.Count < 5 && TxtSkill.Text != "")
        {
            ListItem olditem = new ListItem();
            olditem = null;
            olditem = ListBoxSkills.Items.FindByText(TxtSkill.Text.ToString());

            if (olditem == null)
            {
                ListItem newitem = new ListItem(TxtSkill.Text.ToString(), TxtSkill.ToString());
                ListBoxSkills.Items.Add(newitem);
                ListBoxSkills.DataBind();
            }
            TxtSkill.Text = "";
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        TxtOwnRangeRequiredFieldValidator.Enabled = false;
        TxtOwnRangeRequiredFieldValidator.Visible = false;

        TxtDescription.config.toolbar = new object[]
        {
            new object[] { "Clear", "Preview" },
            new object[] { "Cut", "Copy", "Paste", "PasteText", "PasteFromWord" },
            new object[] { "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" },
            new object[] { "Form", "Checkbox", "Radio", "TextField", "Textarea", "Select", "Button", "ImageButton", "HiddenField" },
            "/",
            new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" },
            new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote" },
            new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" },
            new object[] { "BidiLtr", "BidiRtl" },
            new object[] { "Link", "Unlink", "Anchor" },
            new object[] { "Image", "Flash", "Table", "HorizontalRule", "Smiley", "SpecialChar", "PageBreak", "Iframe" },
            "/",
            new object[] { "Styles", "Format", "Font", "FontSize" },
            new object[] { "TextColor", "BGColor" },
            new object[] { "Maximize", "ShowBlocks" }
        };

        //System.Diagnostics.Debugger.Break();
        if (!IsPostBack)
        {
            category = new CategoryBL();
            DateTime MaxDate = new DateTime();
            MaxDate = DateTime.Today.AddYears(1);

            ValidateData();

            DrpdlstCategory.DataSource = category.GetCategory();
            DrpdlstCategory.DataBind();

            RangeValidator1.MinimumValue = DateTime.Today.ToShortDateString();
            RangeValidator1.MaximumValue = DateTime.Today.AddYears(1).ToShortDateString();
            RangeValidator1.ErrorMessage = "Date should be between" + DateTime.Today.ToShortDateString() + " and " + DateTime.Today.AddYears(1).ToShortDateString();

            //Edit Flow


            if (Request.QueryString["ProjectId"] != null && Request.QueryString["ProjectId"] != "")
            {
                project   = new ProjectDTO();
                projectbl = new ProjectBL();

                project = projectbl.SelectProjectById(Convert.ToInt64(Request.QueryString["ProjectId"]));

                TxtProjectName.Text     = project.ProjectTitle;
                DdlBudget.SelectedValue = project.Budget;

                TxtDescription.Text = project.Description;
                TxtBidOpenTill.Text = Convert.ToDateTime(project.BidOpenTill).ToString("dd/MM/yyyy");

                DrpdlstCategory.Visible    = false;
                DrpdlstSubcategory.Visible = false;
                // CmpvalCategory.Visible = false;
                //Cmpvalsubcategory.Visible = false;

                DrpdlstCategory.Enabled    = false;
                DrpdlstSubcategory.Enabled = false;
                // CmpvalCategory.Enabled = false;
                //Cmpvalsubcategory.Enabled = false;

                LblCategory.Text    = project.ProjectCategory;
                Lblsubcategory.Text = project.ProjectsubCategory;

                LblCategory.Visible    = true;
                Lblsubcategory.Visible = true;

                string[] skills = Regex.Split(project.ProjectSkills.ToString(), ", ");
                foreach (string skill in skills)
                {
                    ListItem newskill = new ListItem(skill, skill);
                    ListBoxSkills.Items.Add(newskill);
                    ListBoxSkills.DataBind();
                }

                if (project.ProjectLocation.ToString().ToLower() != "No Preference".ToLower())
                {
                    RadioBtnPreferredlocation.Checked = true;
                    Page.RegisterStartupScript("ShowCountryKey", "<script>ShowCountry(true)</script>");
                    drplstCountry.SelectedValue = project.ProjectLocation.ToString();
                }
                else
                {
                    RadioBtnPrefrence.Checked = true;
                }

                if (project.Budget.Substring(0, 1) == "$")
                {
                    DdlBudget.SelectedValue = "Enter My Own Ranges";
                    LblMyownRange.Visible   = true;
                    TxtOwnRange.Visible     = true;
                    TxtOwnRange.Enabled     = true;
                    TxtOwnRange.Text        = project.Budget.Replace("$", "");
                }
                else
                {
                    DdlBudget.SelectedValue = project.Budget;
                }

                if (project.PlannedStart == "Immediately")
                {
                    RdBtnStartImmediately.Checked = true;
                }
                else
                {
                    RdioBtnStartDate.Checked = true;
                    Page.RegisterStartupScript("StartDateTextBoxKey", "<script>ShowStartDateTextBox(true)</script>");
                    TxtStartDate.Text = Convert.ToDateTime(project.ProjectCreatedOn).ToString("dd/MM/yyyy");
                }
                RadioBtnPrefrence.Attributes.Add("onClick", "   (false)");
                RadioBtnPreferredlocation.Attributes.Add("onClick", "ShowCountry(true)");
                RdBtnStartImmediately.Attributes.Add("onClick", "ShowStartDateTextBox(false)");
                RdioBtnStartDate.Attributes.Add("onClick", "ShowStartDateTextBox(true)");
            }
            else
            {
                RadioBtnPrefrence.Attributes.Add("onClick", "ShowCountry(false)");
                RadioBtnPreferredlocation.Attributes.Add("onClick", "ShowCountry(true)");
                RdBtnStartImmediately.Attributes.Add("onClick", "ShowStartDateTextBox(false)");
                RdioBtnStartDate.Attributes.Add("onClick", "ShowStartDateTextBox(true)");
                DrpdlstSubcategory.SelectedIndex = 0;
            }
        }
    }