Пример #1
0
        private void BindApplicantsForCurrentProject(DropDownList ddlEventEntity)
        {
            try
            {
                ddlEventEntity.Items.Clear();

                if ((DataUtils.GetInt(hfProjectId.Value) == 0))
                {
                    ddlEventEntity.DataSource = ApplicantData.GetApplicants();
                }
                else
                {
                    ddlEventEntity.DataSource = ProjectMaintenanceData.GetCurrentProjectApplicants(DataUtils.GetInt(hfProjectId.Value));
                }

                ddlEventEntity.DataValueField = "appnameid";
                ddlEventEntity.DataTextField  = "applicantname";
                ddlEventEntity.DataBind();
                ddlEventEntity.Items.Insert(0, new ListItem("Select", "NA"));
            }
            catch (Exception ex)
            {
                LogError(Pagename, "BindApplicantsForCurrentProject", "", ex.Message);
            }
        }
Пример #2
0
        protected void gvApplicant_Sorting(object sender, GridViewSortEventArgs e)
        {
            GridViewSortExpression = e.SortExpression;
            int pageIndex = 0;

            gvApplicant.DataSource = SortDataTable(ApplicantData.GetApplicants(), false);
            gvApplicant.DataBind();
            gvApplicant.PageIndex = pageIndex;
        }
Пример #3
0
        public void setApplicantLogin(string fname, string lname, DateTime bdate)
        {
            ApplicantData n           = new ApplicantData();
            PromptModel   promptModel = n.checkBooking(fname, lname, bdate);

            Clients.All.getApplicantLogin(promptModel.functionMsg, promptModel.ifunctionVal);

            if (promptModel.ifunctionVal == 0)
            {
                Clients.All.getApplicantList(n.getApplicantLoginbyCode(promptModel.applicantID));
            }
        }
Пример #4
0
        public static string[] GetApplicantLastNames(string prefixText, int count)
        {
            DataTable dt = new DataTable();

            dt = ApplicantData.GetApplicantNamesByLastName(prefixText);

            List <string> applicantLastNames = new List <string>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                applicantLastNames.Add(dt.Rows[i][0].ToString());
            }
            return(applicantLastNames.ToArray());
        }
Пример #5
0
 private void GetApplicant()
 {
     try
     {
         ddlApplicantName.DataSource     = ApplicantData.GetSortedApplicants();
         ddlApplicantName.DataValueField = "appnameid";
         ddlApplicantName.DataTextField  = "Applicantname";
         ddlApplicantName.DataBind();
         ddlApplicantName.Items.Insert(0, new ListItem("Select", "NA"));
     }
     catch (Exception ex)
     {
         lblErrorMsg.Text = ex.Message;
     }
 }
Пример #6
0
 protected void BindApplicants(DropDownList ddList)
 {
     try
     {
         ddList.Items.Clear();
         ddList.DataSource     = ApplicantData.GetSortedApplicants();
         ddList.DataValueField = "appnameid";
         ddList.DataTextField  = "Applicantname";
         ddList.DataBind();
         ddList.Items.Insert(0, new ListItem("Select", "NA"));
     }
     catch (Exception ex)
     {
         LogError(Pagename, "BindApplicants", "", ex.Message);
     }
 }
Пример #7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (rdBtnPayee.SelectedIndex < 0)
                {
                    lblErrorMsg.Text = "Select payee";
                    rdBtnPayee.Focus();
                    return;
                }
                if (rdBtnIndividual.SelectedIndex < 0)
                {
                    lblErrorMsg.Text = "Select individual";
                    rdBtnIndividual.Focus();
                    return;
                }

                bool isPayee      = rdBtnPayee.SelectedItem.Text == "Yes" ? true : false;
                bool isIndividual = rdBtnIndividual.SelectedItem.Text == "Yes" ? true : false;
                if (isIndividual)
                {
                    ApplicantData.AddNewApplicant(txtFName.Text, txtLName.Text, txtLName.Text + ", " + txtFName.Text, isPayee, isIndividual);
                }
                else
                {
                    ApplicantData.AddNewApplicant(txtFName.Text, txtLName.Text, txtApplicantName.Text, isPayee, isIndividual);
                }

                lblErrorMsg.Text      = "Applicant added successfully";
                txtApplicantName.Text = "";
                txtFName.Text         = "";
                txtLName.Text         = "";
                pnlappl.Visible       = false;
                gvApplicant.PageIndex = 0;
                BindApplicants();

                rdBtnIndividual.ClearSelection();
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = ex.Message;
            }
        }
Пример #8
0
 protected void gvApplicant_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     try
     {
         int    rowIndex = e.RowIndex;
         int    ApplId   = Convert.ToInt32(((Label)gvApplicant.Rows[rowIndex].FindControl("lblApplId")).Text);
         string applName = ((TextBox)gvApplicant.Rows[rowIndex].FindControl("txtApplName")).Text;
         ApplicantData.UpdateApplicantName(ApplId, applName);
         gvApplicant.EditIndex = -1;
         BindApplicants();
         lblErrorMsg.Text      = "Applicant updated successfully";
         txtApplicantName.Text = "";
         txtFName.Text         = "";
         txtLName.Text         = "";
         pnlappl.Visible       = false;
     }
     catch (Exception)
     {
         lblErrorMsg.Text    = "Error updating the project name";
         lblErrorMsg.Visible = true;
     }
 }
Пример #9
0
 protected void BindApplicants()
 {
     try
     {
         if (Session["SortExp"] == null)
         {
             gvApplicant.DataSource = ApplicantData.GetApplicants();
             gvApplicant.DataBind();
         }
         else
         {
             DataTable table = ApplicantData.GetApplicants();
             DataView  view  = table.DefaultView;
             view.Sort = Session["SortExp"].ToString();
             gvApplicant.DataSource = view.ToTable();
             gvApplicant.DataBind();
         }
     }
     catch (Exception ex)
     {
         lblErrorMsg.Text = ex.Message;
     }
 }