protected void grdSponsor_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.ddlSponsors.SelectedValue     = grdSponsor.SelectedRow.Cells[0].Text;
     this.txtBudget.Text                = grdSponsor.SelectedRow.Cells[2].Text;
     this.ddlCurrency.SelectedItem.Text = (grdSponsor.SelectedRow.Cells[3].Text == "") ? "--- Select Currency ---" : grdSponsor.SelectedRow.Cells[3].Text;
     this.txtFromDate.Text              = CheckNull.NullString(grdSponsor.SelectedRow.Cells[4].Text);
 }
Esempio n. 2
0
    protected void btnPhonePlus_Click(object sender, EventArgs e)
    {
        lblStatusMessage.Text = "";
        DataTable tmpPhoneTbl = (DataTable)Session["PhoneTbl"];

        if (this.ddlPhoneType_Phone.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "फोनको किसिम छान्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.txtPhoneNumber_Phone.Text == "")
        {
            this.lblStatusMessage.Text = "फोन न. राख्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (grdPhone.SelectedIndex == -1)
        {
            DataRow row = tmpPhoneTbl.NewRow();
            row[1] = this.ddlPhoneType_Phone.SelectedValue;
            row[2] = this.ddlPhoneType_Phone.SelectedItem.ToString();
            row[3] = 0;
            row[4] = this.txtPhoneNumber_Phone.Text.Trim();
            row[5] = "Y";
            row[6] = "";
            row[7] = "A";
            tmpPhoneTbl.Rows.Add(row);
        }

        else
        {
            DataRow oldrow = tmpPhoneTbl.Rows[this.grdPhone.SelectedIndex];
            oldrow[1] = this.ddlPhoneType_Phone.SelectedValue;
            oldrow[2] = this.ddlPhoneType_Phone.SelectedItem.ToString();
            oldrow[4] = this.txtPhoneNumber_Phone.Text.Trim();
            oldrow[5] = "Y";
            oldrow[6] = "";
            if ((CheckNull.NullString(oldrow[7].ToString()) == "E") || (CheckNull.NullString(oldrow[7].ToString()) == ""))
            {
                oldrow[7] = "E";
            }
            else
            {
                oldrow[7] = "A";
            }
        }

        this.ddlPhoneType_Phone.SelectedIndex = 0;
        this.txtPhoneNumber_Phone.Text        = "";
        //this.txtPhoneRemarks.Text = "";
        this.grdPhone.DataSource = tmpPhoneTbl;
        this.grdPhone.DataBind();
        this.grdPhone.SelectedIndex = -1;
        //SetGridColor(7, 9, grdPhone);
    }
 protected void grdWritSubCatSubTitle_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CheckNull.NullString(this.grdWritSubCatSubTitle.SelectedRow.Cells[6].Text) == "")
     {
         this.grdWritSubCatSubTitle.SelectedRow.Cells[6].Text = "E";
     }
     this.txtWritSubCatSubTitle.Text          = this.grdWritSubCatSubTitle.SelectedRow.Cells[4].Text;
     this.chkWritSubCatSubTitleActive.Checked = (this.grdWritSubCatSubTitle.SelectedRow.Cells[5].Text == "Y") ? true : false;
 }
Esempio n. 4
0
    protected void btnEMailPlus_Click(object sender, EventArgs e)
    {
        lblStatusMessage.Text = "";
        DataTable tmpEMailTbl = (DataTable)Session["EMailTbl"];

        if (this.ddlEMailType_EMail.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "ईमेलको किसिम छान्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.txtEMail_EMail.Text == "")
        {
            this.lblStatusMessage.Text = "ईमेल ठेगाना राख्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.grdEMail.SelectedIndex == -1)
        {
            DataRow row = tmpEMailTbl.NewRow();
            row[1] = this.ddlEMailType_EMail.SelectedValue;
            row[2] = this.ddlEMailType_EMail.SelectedItem.ToString();
            row[3] = 0;
            row[4] = this.txtEMail_EMail.Text.Trim();
            row[5] = "Y";
            row[6] = "";
            row[7] = "A";
            tmpEMailTbl.Rows.Add(row);
        }
        else
        {
            DataRow oldrow = tmpEMailTbl.Rows[this.grdEMail.SelectedIndex];
            oldrow[1] = this.ddlEMailType_EMail.SelectedValue;
            oldrow[2] = this.ddlEMailType_EMail.SelectedItem.ToString();
            oldrow[4] = this.txtEMail_EMail.Text.Trim();
            oldrow[5] = "Y";
            oldrow[6] = "";
            if ((CheckNull.NullString(oldrow[7].ToString()) == "E") || (CheckNull.NullString(oldrow[7].ToString()) == ""))
            {
                oldrow[7] = "E";
            }
            else
            {
                oldrow[7] = "A";
            }
        }

        this.ddlEMailType_EMail.SelectedIndex = 0;
        this.txtEMail_EMail.Text = "";
        this.grdEMail.DataSource = tmpEMailTbl;
        this.grdEMail.DataBind();
        this.grdEMail.SelectedIndex = -1;
        //SetGridColor(7, 9, grdEMail);
    }
    protected void btnAddSession_Click(object sender, EventArgs e)
    {
        if (this.txtSessionName.Text == "")
        {
            this.lblStatus.Text        = "Add Session Status";
            this.lblStatusMessage.Text = "Session Name Can't Be Left Blank";
            this.programmaticModalPopup.Show();
            return;
        }


        List <ATTSession> SessionLST = new List <ATTSession>();

        foreach (GridViewRow gvRow in grdSession.Rows)
        {
            SessionLST.Add(new ATTSession(
                               0, 0,
                               int.Parse(gvRow.Cells[0].Text),
                               CheckNull.NullString(gvRow.Cells[1].Text),
                               CheckNull.NullString(gvRow.Cells[2].Text),
                               CheckNull.NullString(gvRow.Cells[3].Text),
                               CheckNull.NullString(gvRow.Cells[2].Text),
                               CheckNull.NullString(gvRow.Cells[4].Text)
                               ));
        }


        if (grdSession.SelectedIndex == -1)
        {
            SessionLST.Add(new ATTSession(
                               0, 0,
                               0,
                               this.txtSessionName.Text,
                               this.txtSessionFromDate.Text,
                               this.txtTime.Text,
                               this.txtSessionFromDate.Text,
                               "A"));
        }
        else
        {
            SessionLST[grdSession.SelectedIndex].SessionName = this.txtSessionName.Text;
            SessionLST[grdSession.SelectedIndex].FromDate    = this.txtSessionFromDate.Text;
            SessionLST[grdSession.SelectedIndex].Time        = this.txtTime.Text;
            SessionLST[grdSession.SelectedIndex].Action      = (this.grdSession.SelectedRow.Cells[3].Text == "A") ? "A" : "E";
        }

        grdSession.DataSource = SessionLST;
        grdSession.DataBind();

        this.grdSession.SelectedIndex = -1;
        this.txtSessionName.Text      = "";
        this.txtTime.Text             = "";
        this.txtSessionFromDate.Text  = "";
    }
    protected void btnAddCourse_Click(object sender, EventArgs e)
    {
        if (this.txtCourseTitle.Text == "")
        {
            this.lblStatus.Text        = "Add Course Status";
            this.lblStatusMessage.Text = "Course Title Can't be Left Blank";
            this.programmaticModalPopup.Show();
            return;
        }

        List <ATTCourse> CourseLST = new List <ATTCourse>();

        foreach (GridViewRow gvRow in grdCourses.Rows)
        {
            CourseLST.Add(new ATTCourse(0, 0,
                                        CheckNull.NullintValue(gvRow.Cells[0].Text),
                                        gvRow.Cells[1].Text,
                                        CheckNull.NullString(gvRow.Cells[2].Text),
                                        CheckNull.NullString(gvRow.Cells[3].Text),
                                        CheckNull.NullString(gvRow.Cells[4].Text)
                                        ));
        }


        if (grdCourses.SelectedIndex == -1)
        {
            CourseLST.Add(new ATTCourse(0, 0, 0,
                                        this.txtCourseTitle.Text,
                                        this.txtCourseDescription.Text,
                                        (this.chkCourseActive.Checked == true) ? "Y" : "N",
                                        "A"
                                        ));
        }
        else
        {
            CourseLST[grdCourses.SelectedIndex].CourseTitle = this.txtCourseTitle.Text;
            CourseLST[grdCourses.SelectedIndex].Description = this.txtCourseDescription.Text;
            CourseLST[grdCourses.SelectedIndex].Active      = (this.chkCourseActive.Checked == true) ? "Y" : "N";
            CourseLST[grdCourses.SelectedIndex].Action      = (this.grdCourses.SelectedRow.Cells[4].Text == "A")?"A": "E";
        }

        grdCourses.SelectedIndex       = -1;
        this.txtCourseTitle.Text       = "";
        this.txtCourseDescription.Text = "";
        this.chkCourseActive.Checked   = false;

        this.grdCourses.DataSource = CourseLST;
        this.grdCourses.DataBind();
    }
    protected void grdWritSubCatTitle_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (CheckNull.NullString(this.grdWritSubCatTitle.SelectedRow.Cells[5].Text) == "")
        {
            this.grdWritSubCatTitle.SelectedRow.Cells[5].Text = "E";
        }
        this.txtWritSubCatTitle.Text          = this.grdWritSubCatTitle.SelectedRow.Cells[3].Text;
        this.chkWritSubCatTitleActive.Checked = (this.grdWritSubCatTitle.SelectedRow.Cells[4].Text == "Y") ? true : false;

        ATTWritSubject         WritSubjectOBJ = (ATTWritSubject)Session["TempWritSubject"];
        List <ATTWritCategory> WritSubCatLST  = WritSubjectOBJ.WritCategoryLST;


        this.grdWritSubCatSubTitle.DataSource = WritSubCatLST[this.grdWritCategory.SelectedIndex].WritCategoryTitleLST[this.grdWritSubCatTitle.SelectedIndex].WritCategorySubTitleLST;
        this.grdWritSubCatSubTitle.DataBind();
    }
Esempio n. 8
0
    protected void grdEMail_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridViewRow row;

        if (this.grdEMail.SelectedIndex > -1)
        {
            if (this.grdEMail.Rows[this.grdEMail.SelectedIndex].Cells[7].Text != "D")
            {
                row = this.grdEMail.SelectedRow;
                this.ddlEMailType_EMail.SelectedValue = CheckNull.NullString(row.Cells[1].Text.ToString());
                this.txtEMail_EMail.Text = CheckNull.NullString(row.Cells[4].Text);
            }
            else
            {
                this.grdEMail.SelectedIndex = -1;
            }
        }
    }
Esempio n. 9
0
    protected void grdPhone_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridViewRow row;

        if (this.grdPhone.SelectedIndex > -1)
        {
            if (this.grdPhone.Rows[this.grdPhone.SelectedIndex].Cells[7].Text != "D")
            {
                row = this.grdPhone.SelectedRow;
                this.ddlPhoneType_Phone.SelectedValue = CheckNull.NullString(row.Cells[1].Text.ToString());
                this.txtPhoneNumber_Phone.Text        = CheckNull.NullString(row.Cells[4].Text);
                //this.txtPhoneRemarks.Text =   CheckNull.NullString(row.Cells[6].Text);
            }
            else
            {
                this.grdPhone.SelectedIndex = -1;
            }
        }
    }
    protected void btnEMailPlus_Click(object sender, EventArgs e)
    {
        lblStatusMessage.Text = "";
        DataTable tmpEMailTbl = (DataTable)Session["EMailTbl"];

        if (this.ddlEMailType_EMail.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "ईमेलको किसिम छान्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.txtEMail.Text == "")
        {
            this.lblStatusMessage.Text = "ईमेल ठेगाना राख्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.grdEMail.SelectedIndex == -1)
        {
            DataRow row = tmpEMailTbl.NewRow();
            row[1] = this.ddlEMailType_EMail.SelectedValue;
            row[2] = this.ddlEMailType_EMail.SelectedItem.ToString();
            row[3] = 0;
            row[4] = this.txtEMail.Text.Trim();
            row[5] = "Y";
            row[6] = "";
            row[7] = "A";
            tmpEMailTbl.Rows.Add(row);
        }
        else
        {
            DataRow oldrow = tmpEMailTbl.Rows[this.grdEMail.SelectedIndex];
            oldrow[1] = this.ddlEMailType_EMail.SelectedValue;
            oldrow[2] = this.ddlEMailType_EMail.SelectedItem.ToString();
            oldrow[4] = this.txtEMail.Text.Trim();
            oldrow[5] = "Y";
            oldrow[6] = "";
            if ((CheckNull.NullString(oldrow[7].ToString()) == "E") || (CheckNull.NullString(oldrow[7].ToString()) == ""))
            {
                oldrow[7] = "E";
            }
            else
            {
                oldrow[7] = "A";
            }
        }

        this.ddlEMailType_EMail.SelectedIndex = 0;
        this.txtEMail.Text       = "";
        this.grdEMail.DataSource = tmpEMailTbl;
        this.grdEMail.DataBind();
        for (int j = 0; j < grdEMail.Rows.Count; j++)
        {
            if (grdEMail.Rows[j].Cells[7].Text == "D")
            {
                ((LinkButton)grdEMail.Rows[j].Cells[9].Controls[0]).Text = "UNDO";
            }
            else
            {
                ((LinkButton)grdEMail.Rows[j].Cells[9].Controls[0]).Text = "DELETE";
            }
        }
        this.grdEMail.SelectedIndex = -1;
    }
    protected void lstProgram_SelectedIndexChanged(object sender, EventArgs e)
    {
        clearAll(0);
        List <ATTProgram> ProgramLST = (List <ATTProgram>)Session["Programs"];

        this.txtProgramName_RQD.Text       = ProgramLST[lstProgram.SelectedIndex].ProgramName;
        this.ddlProgramType.SelectedValue  = ProgramLST[lstProgram.SelectedIndex].ProgramTypeID.ToString();
        this.chkActive.Checked             = (ProgramLST[lstProgram.SelectedIndex].Active == "Y") ? true : false;
        this.txtPrgDescription.Text        = ProgramLST[lstProgram.SelectedIndex].Description;
        this.txtLaunchDate_REQD.Text       = ProgramLST[lstProgram.SelectedIndex].LaunchDate;
        this.txtduration.Text              = ProgramLST[lstProgram.SelectedIndex].Duration;
        this.ddlDurationType.SelectedValue = ProgramLST[lstProgram.SelectedIndex].DurationTypeID.ToString();
        this.txtLocation.Text              = ProgramLST[lstProgram.SelectedIndex].Location;

        //BINDS COORDINATOR DETAIL TO GRID
        this.grdProgramCoordinator.DataSource = ProgramLST[lstProgram.SelectedIndex].PrgCoordinatorLST;
        this.grdProgramCoordinator.DataBind();

        DataTable tblCoordinators = (DataTable)Session["CoordinatorTbl"];

        tblCoordinators.Rows.Clear();
        DataRow row;

        if (grdProgramCoordinator.Rows.Count > 0)
        {
            foreach (GridViewRow gvRow in grdProgramCoordinator.Rows)
            {
                row = tblCoordinators.NewRow();
                row["ProgramCoordinatorID"] = gvRow.Cells[1].Text;
                row["PID"]               = gvRow.Cells[2].Text;
                row["CoordinatorName"]   = gvRow.Cells[3].Text;
                row["CoordinatorTypeID"] = gvRow.Cells[4].Text;
                row["CoordinatorType"]   = gvRow.Cells[5].Text;
                row["Action"]            = CheckNull.NullString(gvRow.Cells[6].Text);

                try
                {
                    tblCoordinators.Rows.Add(row);
                }
                catch (Exception)
                {
                }
            }
        }


        //BINDS SPONSORS DETAIL TO GRID
        this.grdSponsor.DataSource = ProgramLST[lstProgram.SelectedIndex].PrgSponsorLST;
        this.grdSponsor.DataBind();

        //BINDS SESSION DETAIL TO GRID
        this.grdSession.DataSource = ProgramLST[lstProgram.SelectedIndex].SessionLST;
        this.grdSession.DataBind();

        //BINDS COURSE DETAIL TO GRID
        this.grdCourses.DataSource = ProgramLST[lstProgram.SelectedIndex].CourseLST;
        this.grdCourses.DataBind();

        //LOADS FACULTY MEMBERS FOR COORDINATORS
        this.LoadCoordinator(int.Parse(Session["OrgID"].ToString()), null);
        //this.LoadCoordinator(1, null);
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        List <ATTApplication> ApplicationLST = (List <ATTApplication>)Session["Applications"];


        int i = -1;

        if (this.lstApplication.SelectedIndex > -1)
        {
            i = ApplicationLST.FindIndex(delegate(ATTApplication obj)
            {
                return(this.txtApplication_RQD.Text.ToUpper() == obj.ApplicationName.ToUpper() && this.lstApplication.SelectedItem.Text.ToUpper() != this.txtApplication_RQD.Text.ToUpper());
            });
        }
        else
        {
            i = ApplicationLST.FindIndex(delegate(ATTApplication obj)
            {
                return(this.txtApplication_RQD.Text.ToUpper() == obj.ApplicationName.ToUpper());
            });
        }

        if (i > -1)
        {
            this.lblStatusMessage.Text = "Application Already Exists";
            this.programmaticModalPopup.Show();
            return;
        }



        if (this.txtApplication_RQD.Text == "")
        {
            this.lblStatusMessage.Text = "Application Can't Be Left Blank";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.ddlApplicationType.SelectedValue == "0")
        {
            this.lblStatusMessage.Text = "Please Select Application Type";
            this.programmaticModalPopup.Show();
            return;
        }


        ATTApplication objApplication = new ATTApplication();

        objApplication.ApplicationID   = lstApplication.SelectedIndex == -1 ? 0 : int.Parse(lstApplication.SelectedValue);
        objApplication.ApplicationName = this.txtApplication_RQD.Text;
        objApplication.ApplicationType = this.ddlApplicationType.SelectedValue;
        objApplication.Active          = this.chkApplicationActive.Checked == true ? "Y" : "N";
        objApplication.EntryBy         = "manoz";
        objApplication.Action          = lstApplication.SelectedIndex == -1 ? "A" : "E";

        CheckBox cb;

        foreach (GridViewRow gvRow in this.grdOrganization.Rows)
        {
            ATTOrgApplication objOrgAppl = new ATTOrgApplication();
            cb = (CheckBox)gvRow.FindControl("chkSelect");
            if (cb.Checked == true || CheckNull.NullString(gvRow.Cells[3].Text) != "")
            {
                objOrgAppl.OrgID         = int.Parse(gvRow.Cells[1].Text);
                objOrgAppl.ApplicationID = (lstApplication.SelectedIndex > -1) ? int.Parse(lstApplication.SelectedValue) : 0;
                if (CheckNull.NullString(gvRow.Cells[3].Text) == "" && cb.Checked == true)
                {
                    objOrgAppl.Active = "Y";
                    objOrgAppl.Action = "A";
                }
                if ((CheckNull.NullString(gvRow.Cells[3].Text) == "Y" && cb.Checked == false))
                {
                    objOrgAppl.Active = "N";
                    objOrgAppl.Action = "E";
                }

                if ((CheckNull.NullString(gvRow.Cells[3].Text) == "N" && cb.Checked == true) || (CheckNull.NullString(gvRow.Cells[3].Text) == "Y" && cb.Checked == true))
                {
                    objOrgAppl.Active = "Y";
                    objOrgAppl.Action = "E";
                }


                objOrgAppl.EntryBy = "manoz";

                objApplication.OrgApplicationLST.Add(objOrgAppl);
            }
        }

        try
        {
            if (BLLApplication.SaveApplication(objApplication) == true)
            {
                if (lstApplication.SelectedIndex == -1)
                {
                    ApplicationLST.Add(objApplication);
                }
                else
                {
                    ApplicationLST.RemoveAt(lstApplication.SelectedIndex);
                    ApplicationLST.Add(objApplication);
                }
                this.lstApplication.DataSource     = ApplicationLST;
                this.lstApplication.DataValueField = "ApplicationID";
                this.lstApplication.DataTextField  = "ApplicationName";
                this.lstApplication.DataBind();


                ClearAll();
            }
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = "Error in Saving Application<BR>" + ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
 protected void grdSession_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.txtSessionName.Text     = grdSession.SelectedRow.Cells[1].Text;
     this.txtSessionFromDate.Text = CheckNull.NullString(grdSession.SelectedRow.Cells[2].Text);
     this.txtTime.Text            = CheckNull.NullString(grdSession.SelectedRow.Cells[3].Text);
 }
Esempio n. 14
0
 protected void grdPhone_SelectedIndexChanged(object sender, EventArgs e)
 {
     ddlPhoneType_Phone.SelectedValue = CheckNull.NullString(grdPhone.SelectedRow.Cells[1].Text.Trim());
     txtPhoneNumber_Phone.Text        = CheckNull.NullString(grdPhone.SelectedRow.Cells[4].Text.Trim());
 }
Esempio n. 15
0
    protected void btnAddPerson_Click(object sender, EventArgs e)
    {
        if (txtFromDate_RQD.Text == "")
        {
            this.lblStatusMessage.Text = "Enter From Date First";
            this.programmaticModalPopup.Show();
            return;
        }
        int    iniUnit          = 3;
        double empID            = 0;
        int    iniType          = 9;
        int?   intCountryId     = null;
        int?   intBirthDistrict = null;
        int?   intReligion      = null;

        ATTPerson objPerson = new ATTPerson();

        if (this.txtPersonID.Text.Trim() != "")
        {
            empID = double.Parse(this.txtPersonID.Text.Trim());
        }
        if (this.ddlCountry.SelectedIndex > 0)
        {
            intCountryId = int.Parse(this.ddlCountry.SelectedValue.ToString());
        }
        if (this.ddlBirthDistrict.SelectedIndex > 0)
        {
            intBirthDistrict = int.Parse(this.ddlBirthDistrict.SelectedValue.ToString());
        }
        if (this.ddlReligion.SelectedIndex > 0)
        {
            intReligion = int.Parse(this.ddlReligion.SelectedValue.ToString());
        }


        #region "PERSONTABLE"
        objPerson = new ATTPerson(empID, this.txtFName_Rqd.Text.Trim(),
                                  this.txtMName.Text.Trim(), this.txtSurName_Rqd.Text.Trim(),
                                  this.txtDOB_DT.Text.Trim(), ((this.ddlGender.SelectedIndex <= 0) ? "" : (this.ddlGender.SelectedValue)),
                                  ((this.ddlMarStatus.SelectedIndex <= 0) ? "" : (this.ddlMarStatus.SelectedValue)),
                                  "", "", intCountryId, intBirthDistrict, intReligion,
                                  iniUnit, iniType, strUser, DateTime.Now, new byte[0]);
        //objPerson.FullName = this.txtFName_Rqd.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim();
        objPerson.EntityType = "P";
        #endregion

        #region "ADDRESS"
        int?             intDistrictAddress = null;
        int?             intVDCAddress      = null;
        int?             intWardAddress     = null;
        string           strAddressAction   = "";
        ATTPersonAddress PersonAddressATT   = null;
        if (this.ddlDistrict.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrict.SelectedValue);
        }
        if (this.ddlVDC.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDC.SelectedValue);
        }
        if (this.ddlWard.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWard.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "P", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtTole.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value != "0"))
        {
            strAddressAction = "E";
        }
        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value == "0"))
        {
            strAddressAction = "A";
        }
        // if (((this.ddlDistrict.SelectedIndex <= 0) && (this.txtTole.Text.Trim() == "")) && (hdnPerAddress.Value != "0")) strAddressAction = "D";
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }

        strAddressAction   = "";
        intDistrictAddress = null;
        intVDCAddress      = null;
        intWardAddress     = null;

        if (this.ddlDistrictTemp.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrictTemp.SelectedValue);
        }
        if (this.ddlVDCTemp.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDCTemp.SelectedValue);
        }
        if (this.ddlWardTemp.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWardTemp.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "T", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtToleTemp.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value != "0"))
        {
            strAddressAction = "E";
        }
        if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value == "0"))
        {
            strAddressAction = "A";
        }
        //if (((this.ddlDistrictTemp.SelectedIndex <= 0) && (this.txtToleTemp.Text.Trim() == "")) && (hdnTempAddress.Value != "0")) strAddressAction = "D";
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }
        #endregion

        #region "PHONE"
        foreach (GridViewRow row in this.grdPhone.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonPhone PersonPhoneATT = new ATTPersonPhone(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonPhoneATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonPhone.Add(PersonPhoneATT);
            }
        }
        #endregion

        #region "EMAIL"
        foreach (GridViewRow row in this.grdEMail.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonEMail PersonEMailATT = new ATTPersonEMail(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonEMailATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonEMail.Add(PersonEMailATT);
            }
        }
        #endregion

        #region "RELATIVES AND BENEFICIARIES"
        //foreach (GridViewRow row in this.grdEmpRelatives.Rows)
        //{
        //    int? countryID = null;
        //    int? birthDistrict = null;
        //    int? religionID = null;
        //    if (  CheckNull.NullString(row.Cells[11].Text) != "")
        //        birthDistrict = int.Parse(row.Cells[11].Text);
        //    byte[] RelativeImageData = new byte[0];
        //    ATTPerson objRelativePerson = new ATTPerson
        //        (double.Parse(row.Cells[1].Text), row.Cells[2].Text,   CheckNull.NullString(row.Cells[3].Text),   CheckNull.NullString(row.Cells[4].Text),
        //          CheckNull.NullString(row.Cells[8].Text),   CheckNull.NullString(row.Cells[6].Text),   CheckNull.NullString(row.Cells[9].Text), "", "",
        //        countryID, birthDistrict, religionID, iniUnit, iniType, strUser, DateTime.Now, RelativeImageData);
        //    CheckBox cb = (CheckBox)row.Cells[17].FindControl("chkRelativeActive");
        //    CheckBox cbIsBen = (CheckBox)row.Cells[16].FindControl("chkIsBeneficiary");
        //    CheckBox cbWasBen = (CheckBox)row.Cells[20].FindControl("chkWasBeneficiary");

        //    ATTEmployeeBeneficiary EmpBeneficiaryATT = new ATTEmployeeBeneficiary(0, 0, null, null);
        //    if ((cbIsBen.Checked) && (!cbWasBen.Checked))
        //        EmpBeneficiaryATT.Action = "A";
        //    else if ((!cbIsBen.Checked) && (cbWasBen.Checked))
        //    {
        //        EmpBeneficiaryATT.Action = "E";
        //        EmpBeneficiaryATT.ToDate = DateTime.Now.Date.ToString("dd/MM/yyyy");
        //    }
        //    EmpBeneficiaryATT.EntryBy = strUser;

        //    ATTRelatives RelativesATT = new ATTRelatives(0, 0, int.Parse(row.Cells[13].Text), (cb.Checked ? "Y" : "N"));
        //    RelativesATT.Occupation =   CheckNull.NullString(row.Cells[15].Text);
        //    RelativesATT.EntryBy = strUser;
        //    if (  CheckNull.NullString(row.Cells[18].Text) == "A")
        //        RelativesATT.Action = "A";
        //    else
        //        RelativesATT.Action = "E";
        //    RelativesATT.ObjPerson = objRelativePerson;
        //    EmpBeneficiaryATT.ObjRelatives = RelativesATT;
        //    objEmployee.LstEmployeeBeneficiary.Add(EmpBeneficiaryATT);
        //}
        #endregion

        List <ATTWitnessSearch> WSearchLST         = (List <ATTWitnessSearch>)Session["WSearch"];
        ATTWitnessSearch        objWSearch         = new ATTWitnessSearch();
        ATTWitnessPerson        objCaesAndlitigant = (ATTWitnessPerson)Session["CaseAndLitigant"];//brought from witness person form caseID and litigantId

        List <ATTWitnessSearch> PersonList = new List <ATTWitnessSearch>();

        objWSearch.CaseID      = objCaesAndlitigant.CaseID;
        objWSearch.LItigantID  = objCaesAndlitigant.LitigantID;
        objWSearch.PersonID    = 0;
        objWSearch.WitnessID   = 0;
        objWSearch.WitnessName = this.txtFName_Rqd.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim();
        objWSearch.FromDate    = this.txtFromDate_RQD.Text;
        objWSearch.Action      = "A";

        objWSearch.ObjPerson = objPerson;

        WSearchLST.Add(objWSearch);
        PersonList.Add(objWSearch);

        Session["WSearch"] = WSearchLST;

        this.grdPerson.DataSource = PersonList;
        this.grdPerson.DataBind();

        ClearControls();
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        List <ATTProgram> ProgramLST = (List <ATTProgram>)Session["Programs"];


        ATTProgram objProgram = new ATTProgram(
            int.Parse(Session["OrgID"].ToString()),
            (this.lstProgram.SelectedIndex != -1) ? ProgramLST[lstProgram.SelectedIndex].ProgramID : 0,
            this.txtProgramName_RQD.Text,
            int.Parse(this.ddlProgramType.SelectedValue),
            this.txtPrgDescription.Text,
            (this.chkActive.Checked == true) ? "Y" : "N",
            this.txtLaunchDate_REQD.Text,
            this.txtduration.Text,
            int.Parse(this.ddlDurationType.SelectedValue),
            "",
            this.txtLocation.Text,
            (this.lstProgram.SelectedIndex != -1) ? "E" : "A"
            );
        ObjectValidation OV = BLLProgram.Validate(objProgram);

        if (OV.IsValid == false)
        {
            this.lblStatusMessage.Text = OV.ErrorMessage;
            this.programmaticModalPopup.Show();
            return;
        }



        //PREPARES COORDINATORS TO BE SAVED
        foreach (GridViewRow gvRow in grdProgramCoordinator.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[6].Text) != "")
            {
                ATTProgramCoordinator objPrgCoordinator = new ATTProgramCoordinator
                                                          (
                    int.Parse(Session["OrgID"].ToString()),
                    0,
                    int.Parse(gvRow.Cells[1].Text),
                    gvRow.Cells[3].Text,
                    double.Parse(gvRow.Cells[2].Text),
                    int.Parse(gvRow.Cells[4].Text),
                    gvRow.Cells[5].Text,
                    gvRow.Cells[6].Text
                                                          );
                objProgram.PrgCoordinatorLST.Add(objPrgCoordinator);
            }
        }

        //PREPARES SPONSORS TO BE SAVED

        foreach (GridViewRow gvRow in grdSponsor.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[5].Text) != "")
            {
                ATTProgramSponsor objPrgSponsor = new ATTProgramSponsor
                                                  (
                    int.Parse(Session["OrgID"].ToString()),
                    0, int.Parse(gvRow.Cells[0].Text),
                    CheckNull.NullString(gvRow.Cells[4].Text),
                    CheckNull.NulldblValue(gvRow.Cells[2].Text),
                    CheckNull.NullString(gvRow.Cells[3].Text),
                    "",
                    gvRow.Cells[5].Text
                                                  );

                objPrgSponsor.SponsorOBJ.SponsorName = gvRow.Cells[1].Text;
                objProgram.PrgSponsorLST.Add(objPrgSponsor);
            }
        }


        //PREPARES SESSIONS TO BE SAVED

        foreach (GridViewRow gvRow in grdSession.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[4].Text) != "")
            {
                objProgram.SessionLST.Add(new ATTSession
                                          (
                                              int.Parse(Session["OrgID"].ToString()),
                                              0,
                                              CheckNull.NullintValue(gvRow.Cells[0].Text),
                                              gvRow.Cells[1].Text,
                                              CheckNull.NullString(gvRow.Cells[2].Text),
                                              CheckNull.NullString(gvRow.Cells[3].Text),
                                              CheckNull.NullString(gvRow.Cells[2].Text),
                                              gvRow.Cells[4].Text
                                          ));
            }
        }

        //PREPARES COURSES TO BE SAVED

        foreach (GridViewRow gvRow in grdCourses.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[4].Text) != "")
            {
                objProgram.CourseLST.Add(new ATTCourse
                                         (
                                             int.Parse(Session["OrgID"].ToString()), 0,
                                             CheckNull.NullintValue(gvRow.Cells[0].Text),
                                             gvRow.Cells[1].Text,
                                             CheckNull.NullString(gvRow.Cells[2].Text),
                                             gvRow.Cells[3].Text,
                                             gvRow.Cells[4].Text
                                         ));
            }
        }


        BLLProgram.AddProgram(objProgram);
        if (lstProgram.SelectedIndex == -1)
        {
            ProgramLST.Add(objProgram);
        }
        else
        {
            //EDITS THE PROGRAM
            ProgramLST[lstProgram.SelectedIndex].ProgramName    = this.txtProgramName_RQD.Text;
            ProgramLST[lstProgram.SelectedIndex].ProgramTypeID  = int.Parse(this.ddlProgramType.SelectedValue);
            ProgramLST[lstProgram.SelectedIndex].Active         = (this.chkActive.Checked == true) ? "Y" : "N";
            ProgramLST[lstProgram.SelectedIndex].Description    = this.txtPrgDescription.Text;
            ProgramLST[lstProgram.SelectedIndex].LaunchDate     = this.txtLaunchDate_REQD.Text;
            ProgramLST[lstProgram.SelectedIndex].Duration       = this.txtduration.Text;
            ProgramLST[lstProgram.SelectedIndex].DurationTypeID = int.Parse(this.ddlDurationType.SelectedValue);
            ProgramLST[lstProgram.SelectedIndex].Location       = this.txtLocation.Text;


            //EDITS THE PROGRAM COORDINATOR LIST
            ProgramLST[lstProgram.SelectedIndex].PrgCoordinatorLST.Clear();
            foreach (GridViewRow gvRow in this.grdProgramCoordinator.Rows)
            {
                if (CheckNull.NullString(gvRow.Cells[6].Text) == "")
                {
                    ATTProgramCoordinator objPrgCoordinator = new ATTProgramCoordinator
                                                              (
                        int.Parse(Session["OrgID"].ToString()),
                        int.Parse(lstProgram.SelectedValue),
                        int.Parse(gvRow.Cells[1].Text),
                        gvRow.Cells[3].Text,
                        double.Parse(gvRow.Cells[2].Text),
                        int.Parse(gvRow.Cells[4].Text),
                        gvRow.Cells[5].Text,
                        ""
                                                              );
                    ProgramLST[lstProgram.SelectedIndex].PrgCoordinatorLST.Add(objPrgCoordinator);
                }
            }

            foreach (ATTProgramCoordinator obj in objProgram.PrgCoordinatorLST)
            {
                ProgramLST[lstProgram.SelectedIndex].PrgCoordinatorLST.Add(obj);
            }

            //EDITS THE SPONSOR LiST
            ProgramLST[lstProgram.SelectedIndex].PrgSponsorLST.Clear();
            foreach (GridViewRow gvRow in this.grdSponsor.Rows)
            {
                ATTProgramSponsor obj;
                if (gvRow.Cells[5].Text != "D")
                {
                    obj = new ATTProgramSponsor(
                        int.Parse(Session["OrgID"].ToString()),
                        0, int.Parse(gvRow.Cells[0].Text),
                        CheckNull.NullString(gvRow.Cells[4].Text),
                        CheckNull.NulldblValue(gvRow.Cells[2].Text),
                        CheckNull.NullString(gvRow.Cells[3].Text),
                        "",
                        ""
                        );
                    obj.SponsorOBJ.SponsorName = gvRow.Cells[1].Text;
                    ProgramLST[lstProgram.SelectedIndex].PrgSponsorLST.Add(obj);
                }
            }

            //EDITS THE SESSION LIST
            ProgramLST[lstProgram.SelectedIndex].SessionLST.Clear();
            foreach (GridViewRow gvRow in this.grdSession.Rows)
            {
                if (CheckNull.NullString(gvRow.Cells[4].Text) == "")
                {
                    ProgramLST[lstProgram.SelectedIndex].SessionLST.Add(new ATTSession
                                                                        (
                                                                            int.Parse(Session["OrgID"].ToString()),
                                                                            0,
                                                                            CheckNull.NullintValue(gvRow.Cells[0].Text),
                                                                            gvRow.Cells[1].Text,
                                                                            CheckNull.NullString(gvRow.Cells[2].Text),
                                                                            CheckNull.NullString(gvRow.Cells[3].Text),
                                                                            CheckNull.NullString(gvRow.Cells[2].Text),
                                                                            ""
                                                                        ));
                }
            }
            foreach (ATTSession obj in objProgram.SessionLST)
            {
                ProgramLST[lstProgram.SelectedIndex].SessionLST.Add(obj);
            }


            //EDITS COURSE LIST
            ProgramLST[lstProgram.SelectedIndex].CourseLST.Clear();
            foreach (GridViewRow gvRow in grdCourses.Rows)
            {
                if (CheckNull.NullString(gvRow.Cells[4].Text) == "")
                {
                    ProgramLST[lstProgram.SelectedIndex].CourseLST.Add(new ATTCourse
                                                                       (
                                                                           int.Parse(Session["OrgID"].ToString()), 0,
                                                                           CheckNull.NullintValue(gvRow.Cells[0].Text),
                                                                           gvRow.Cells[1].Text,
                                                                           CheckNull.NullString(gvRow.Cells[2].Text),
                                                                           gvRow.Cells[3].Text,
                                                                           ""
                                                                       ));
                }
            }
            foreach (ATTCourse obj in objProgram.CourseLST)
            {
                ProgramLST[lstProgram.SelectedIndex].CourseLST.Add(obj);
            }
        }
        //END IF


        this.lstProgram.DataSource     = ProgramLST;
        this.lstProgram.DataValueField = "ProgramID";
        this.lstProgram.DataTextField  = "ProgramName";
        this.DataBind();

        clearAll(1);
    }
 protected void grdCourses_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.txtCourseTitle.Text       = grdCourses.SelectedRow.Cells[1].Text;
     this.txtCourseDescription.Text = CheckNull.NullString(this.grdCourses.SelectedRow.Cells[2].Text);
     this.chkCourseActive.Checked   = (this.grdCourses.SelectedRow.Cells[3].Text == "Y") ? true : false;
 }
Esempio n. 18
0
    protected void btnAddPerson_Click(object sender, EventArgs e)
    {
        int    iniUnit = 3;
        double orgID   = 0;
        int    iniType = 9;


        string strUser = "******";

        List <ATTPerson> PersonLST = (string)Session["AppOrResp"] == "A" ? (List <ATTPerson>)Session["Appellant"] : (List <ATTPerson>)Session["Respondant"];
        ATTPerson        objPerson = new ATTPerson();


        if (this.txtOrgID.Text.Trim() != "")
        {
            orgID = double.Parse(this.txtOrgID.Text.Trim());
        }


        #region "PERSONTABLE"
        objPerson = new ATTPerson(orgID, this.txtOrgName_RQD.Text.Trim(),
                                  "", "",
                                  "", "",
                                  "",
                                  "", "", null, null, null,
                                  iniUnit, iniType, strUser, DateTime.Now, new byte[0]);
        //objPerson.FullName = this.txtOrgName_RQD.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim();
        //objPerson.EntityType = "P";
        #endregion

        objPerson.FirstName = this.txtOrgName_RQD.Text.Trim();
//        objPerson.FullName = this.txtOrgName_RQD.Text.Trim();
        objPerson.IniUnit    = 9;
        objPerson.IniType    = 9;
        objPerson.EntryBy    = "manoz";
        objPerson.EntityType = "O";
        objPerson.Photo      = new byte[0];
        objPerson.RegdNO     = this.txtRegNo.Text.Trim();
        objPerson.PanNo      = this.txtPanNo.Text.Trim();

        #region "ADDRESS"
        int?             intDistrictAddress = null;
        int?             intVDCAddress      = null;
        int?             intWardAddress     = null;
        string           strAddressAction   = "";
        ATTPersonAddress PersonAddressATT   = null;
        if (this.ddlDistrict.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrict.SelectedValue);
        }
        if (this.ddlVDC.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDC.SelectedValue);
        }
        if (this.ddlWard.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWard.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "P", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtTole.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")))
        {
            strAddressAction = "E";
        }
        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")))
        {
            strAddressAction = "A";
        }
        if (((this.ddlDistrict.SelectedIndex <= 0) && (this.txtTole.Text.Trim() == "")))
        {
            strAddressAction = "D";
        }
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }

        strAddressAction   = "";
        intDistrictAddress = null;
        intVDCAddress      = null;
        intWardAddress     = null;


        #endregion

        #region "PHONE"
        foreach (GridViewRow row in this.grdPhone.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonPhone PersonPhoneATT = new ATTPersonPhone(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonPhoneATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonPhone.Add(PersonPhoneATT);
            }
        }
        #endregion

        #region "EMAIL"
        foreach (GridViewRow row in this.grdEMail.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonEMail PersonEMailATT = new ATTPersonEMail(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonEMailATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonEMail.Add(PersonEMailATT);
            }
        }
        #endregion


        PersonLST.Add(objPerson);


        if ((string)Session["AppOrResp"] == "A")
        {
            Session["Appellant"] = PersonLST;
        }
        else
        {
            Session["Respondant"] = PersonLST;
        }



        this.grdPerson.DataSource = PersonLST;
        this.grdPerson.DataBind();

        //this.
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        int              iniUnit          = 3;
        double           empID            = 0;
        int              iniType          = 9;
        int?             intCountryId     = null;
        int?             intBirthDistrict = null;
        int?             intReligion      = null;
        List <ATTPerson> lstPerson        = new List <ATTPerson>();
        ATTPerson        objPerson        = new ATTPerson();

        if (this.txtPersonID.Text.Trim() != "")
        {
            empID = double.Parse(this.txtPersonID.Text.Trim());
        }
        if (this.ddlCountry.SelectedIndex > 0)
        {
            intCountryId = int.Parse(this.ddlCountry.SelectedValue.ToString());
        }
        if (this.ddlBirthDistrict.SelectedIndex > 0)
        {
            intBirthDistrict = int.Parse(this.ddlBirthDistrict.SelectedValue.ToString());
        }
        if (this.ddlReligion.SelectedIndex > 0)
        {
            intReligion = int.Parse(this.ddlReligion.SelectedValue.ToString());
        }


        #region "PERSONTABLE"
        objPerson = new ATTPerson(empID, this.txtFName_Rqd.Text.Trim(),
                                  this.txtMName.Text.Trim(), this.txtSurName_Rqd.Text.Trim(),
                                  this.txtDOB_DT.Text.Trim(), ((this.ddlGender.SelectedIndex <= 0) ? "" : (this.ddlGender.SelectedValue)),
                                  ((this.ddlMarStatus.SelectedIndex <= 0) ? "" : (this.ddlMarStatus.SelectedValue)),
                                  "", "", intCountryId, intBirthDistrict, intReligion,
                                  iniUnit, iniType, strUser, DateTime.Now, new byte[0]);
        //objPerson.FullName = this.txtFName_Rqd.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim();
        objPerson.EntityType = "P";
        #endregion

        #region "ADDRESS"
        int?             intDistrictAddress = null;
        int?             intVDCAddress      = null;
        int?             intWardAddress     = null;
        string           strAddressAction   = "";
        ATTPersonAddress PersonAddressATT   = null;
        if (this.ddlDistrict.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrict.SelectedValue);
        }
        if (this.ddlVDC.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDC.SelectedValue);
        }
        if (this.ddlWard.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWard.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "P", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtTole.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value != "0"))
        {
            strAddressAction = "E";
        }
        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value == "0"))
        {
            strAddressAction = "A";
        }
        // if (((this.ddlDistrict.SelectedIndex <= 0) && (this.txtTole.Text.Trim() == "")) && (hdnPerAddress.Value != "0")) strAddressAction = "D";
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }

        strAddressAction   = "";
        intDistrictAddress = null;
        intVDCAddress      = null;
        intWardAddress     = null;

        if (this.ddlDistrictTemp.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrictTemp.SelectedValue);
        }
        if (this.ddlVDCTemp.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDCTemp.SelectedValue);
        }
        if (this.ddlWardTemp.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWardTemp.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "T", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtToleTemp.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value != "0"))
        {
            strAddressAction = "E";
        }
        if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value == "0"))
        {
            strAddressAction = "A";
        }
        //if (((this.ddlDistrictTemp.SelectedIndex <= 0) && (this.txtToleTemp.Text.Trim() == "")) && (hdnTempAddress.Value != "0")) strAddressAction = "D";
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }
        #endregion

        #region "PHONE"
        foreach (GridViewRow row in this.grdPhone.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonPhone PersonPhoneATT = new ATTPersonPhone(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonPhoneATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonPhone.Add(PersonPhoneATT);
            }
        }
        #endregion

        #region "EMAIL"
        foreach (GridViewRow row in this.grdEMail.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonEMail PersonEMailATT = new ATTPersonEMail(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonEMailATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonEMail.Add(PersonEMailATT);
            }
        }
        #endregion


        lstPerson.Add(objPerson);
        if (BLLPerson.SavePerson(lstPerson))
        {
            Session["PersonName"] = lstPerson[0].FullName;
            Session["PersonID"]   = double.Parse(lstPerson[0].PId.ToString());
            ClearControls();
        }
        // btnOK.Attributes.Add("OnClick", "self.close()");
    }
    protected void btnAddCoordinator_Click(object sender, EventArgs e)
    {
        CheckBox cb;



        if (ddlCoordinatorType.SelectedValue == "0")
        {
            this.lblStatus.Text        = "Add Coordinator to Grid";
            this.lblStatusMessage.Text = "Please Select Coordinator Type";
            this.programmaticModalPopup.Show();
            return;
        }



        DataTable tblCoordinators = (DataTable)Session["CoordinatorTbl"];

        tblCoordinators.Rows.Clear();
        DataRow row;

        if (grdProgramCoordinator.Rows.Count > 0)
        {
            foreach (GridViewRow gvRow in grdProgramCoordinator.Rows)
            {
                row = tblCoordinators.NewRow();
                row["ProgramCoordinatorID"] = gvRow.Cells[1].Text;
                row["PID"]               = gvRow.Cells[2].Text;
                row["CoordinatorName"]   = gvRow.Cells[3].Text;
                row["CoordinatorTypeID"] = gvRow.Cells[4].Text;
                row["CoordinatorType"]   = gvRow.Cells[5].Text;
                row["Action"]            = CheckNull.NullString(gvRow.Cells[6].Text);

                try
                {
                    tblCoordinators.Rows.Add(row);
                }
                catch (Exception)
                {
                }
            }
        }



        foreach (GridViewRow gvRow in grdFacultyMember.Rows)
        {
            cb = (CheckBox)gvRow.FindControl("chkSelect");
            if (cb.Checked == true)
            {
                cb.Checked = false;
                row        = tblCoordinators.NewRow();

                row["ProgramCoordinatorID"] = 0;
                row["PID"]               = gvRow.Cells[4].Text;
                row["CoordinatorName"]   = gvRow.Cells[5].Text;
                row["CoordinatorTypeID"] = ddlCoordinatorType.SelectedValue;
                row["CoordinatorType"]   = ddlCoordinatorType.SelectedItem.Text;
                row["Action"]            = "A";

                try
                {
                    tblCoordinators.Rows.Add(row);
                }
                catch (Exception)
                {
                }

                //tblSponsors.DefaultView.Sort = "SponsorName";
            }
        }

        grdProgramCoordinator.DataSource = tblCoordinators;
        grdProgramCoordinator.DataBind();
        this.ddlCoordinatorType.SelectedIndex    = -1;
        this.grdProgramCoordinator.SelectedIndex = -1;
        this.grdFacultyMember.SelectedIndex      = -1;

        Session["CoordinatorTbl"] = tblCoordinators;

        foreach (GridViewRow gvRow in grdProgramCoordinator.Rows)
        {
            if (gvRow.Cells[6].Text == "D")
            {
                gvRow.ForeColor = System.Drawing.Color.Red;
            }
        }
    }
    protected void btnNext_Click(object sender, EventArgs e)
    {
        ATTUserLogin        user  = ((ATTUserLogin)Session["Login_User_Detail"]);
        ATTCaseRegistration objCR = new ATTCaseRegistration();

        objCR.CaseID      = double.Parse(this.lblCaseNo.Text);
        objCR.CaseSummary = this.heCaseSummary.Text;
        objCR.Action      = "E";

        //ADDS CASE EVIDENCE TO THE LIST
        ATTCaseEvidence objCaseEvidence;// = new ATTCaseEvidence();

        foreach (GridViewRow gvRow    in this.grdEvidence.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[2].Text) != "")
            {
                objCaseEvidence            = new ATTCaseEvidence();
                objCaseEvidence.CaseID     = double.Parse(this.lblCaseNo.Text);
                objCaseEvidence.EvidenceID = int.Parse(gvRow.Cells[0].Text);
                objCaseEvidence.Evidence   = gvRow.Cells[1].Text;
                objCaseEvidence.EntryBy    = user.UserName;
                objCaseEvidence.Action     = gvRow.Cells[2].Text;

                objCR.CaseEvidenceLST.Add(objCaseEvidence);
            }
        }

        //ADDS CASE DOCUMENTS
        List <ATTCaseDocuments> CDocLST = (List <ATTCaseDocuments>)Session["CaseDocuments"];

        //List<ATTCaseDocuments> CaseDocLST = new List<ATTCaseDocuments>();
        //ATTCaseDocuments CaseDocOBJ;
        //foreach (DocFup obj in CDocLST)
        //{
        //    CaseDocOBJ = new ATTCaseDocuments();
        //    CaseDocOBJ.CaseID = double.Parse(lblCaseNo.Text);
        //    CaseDocOBJ.DocSeq = obj.DocSeq;
        //    CaseDocOBJ.DocumentID = 0;
        //    CaseDocOBJ.DocumentFileName = obj.FileName;
        //    CaseDocOBJ.DocumentContent = obj.FileContents;
        //    CaseDocOBJ.EntryBy = "manoz";
        //    CaseDocOBJ.Action = "A";

        //    CaseDocLST.Add(CaseDocOBJ);

        //}
        CDocLST.RemoveAll(delegate(ATTCaseDocuments obj)
        {
            return(obj.DocumentFileName == null);
        });
        objCR.CaseDocumentLST = CDocLST;

        //ADDS CASE LITIGANT DOCUMENTS
        List <ATTCaseDocumentsLit> CaseDocLitLST = (List <ATTCaseDocumentsLit>)Session["LitDocuments"];

        CaseDocLitLST.RemoveAll(delegate(ATTCaseDocumentsLit obj)
        {
            return(obj.Action == "");
        });
        objCR.CaseDocumentLitLST = CaseDocLitLST;

        if (BLLCaseRegistration.UpdateCaseSummary(objCR) == true)
        {
            Session["CaseNo"] = this.txtCaseNo.Text;
            Response.Redirect("CaseRegistrationInfo.aspx");
        }
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        int              iniUnit          = 3;
        double           empID            = 0;
        int              iniType          = 9;
        int?             intCountryId     = null;
        int?             intBirthDistrict = null;
        int?             intReligion      = null;
        List <ATTPerson> lstPerson        = new List <ATTPerson>();
        ATTPerson        objPerson        = new ATTPerson();

        if (this.txtPersonID.Text.Trim() != "")
        {
            empID = double.Parse(this.txtPersonID.Text.Trim());
        }
        if (this.ddlCountry.SelectedIndex > 0)
        {
            intCountryId = int.Parse(this.ddlCountry.SelectedValue.ToString());
        }
        if (this.ddlBirthDistrict.SelectedIndex > 0)
        {
            intBirthDistrict = int.Parse(this.ddlBirthDistrict.SelectedValue.ToString());
        }
        if (this.ddlReligion.SelectedIndex > 0)
        {
            intReligion = int.Parse(this.ddlReligion.SelectedValue.ToString());
        }


        #region "PERSONTABLE"
        objPerson = new ATTPerson(empID, this.txtFName_Rqd.Text.Trim(),
                                  this.txtMName.Text.Trim(), this.txtSurName_Rqd.Text.Trim(),
                                  this.txtDOB_DT.Text.Trim(), ((this.ddlGender.SelectedIndex <= 0) ? "" : (this.ddlGender.SelectedValue)),
                                  ((this.ddlMarStatus.SelectedIndex <= 0) ? "" : (this.ddlMarStatus.SelectedValue)),
                                  "", "", intCountryId, intBirthDistrict, intReligion,
                                  iniUnit, iniType, strUser, DateTime.Now, new byte[0]);
        //objPerson.FullName = this.txtFName_Rqd.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim();
        objPerson.EntityType = "P";
        #endregion

        #region "ADDRESS"
        int?             intDistrictAddress = null;
        int?             intVDCAddress      = null;
        int?             intWardAddress     = null;
        string           strAddressAction   = "";
        ATTPersonAddress PersonAddressATT   = null;
        if (this.ddlDistrict.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrict.SelectedValue);
        }
        if (this.ddlVDC.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDC.SelectedValue);
        }
        if (this.ddlWard.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWard.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "P", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtTole.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        //if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value != "0")) strAddressAction = "E";
        //if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value == "0")) strAddressAction = "A";
        //// if (((this.ddlDistrict.SelectedIndex <= 0) && (this.txtTole.Text.Trim() == "")) && (hdnPerAddress.Value != "0")) strAddressAction = "D";
        strAddressAction = "A";
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }

        strAddressAction   = "";
        intDistrictAddress = null;
        intVDCAddress      = null;
        intWardAddress     = null;

        strAddressAction = "A";
        if (this.ddlDistrictTemp.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrictTemp.SelectedValue);
        }
        if (this.ddlVDCTemp.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDCTemp.SelectedValue);
        }
        if (this.ddlWardTemp.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWardTemp.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "T", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtToleTemp.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        //if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value != "0")) strAddressAction = "E";
        // if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value == "0")) strAddressAction = "A";
        //if (((this.ddlDistrictTemp.SelectedIndex <= 0) && (this.txtToleTemp.Text.Trim() == "")) && (hdnTempAddress.Value != "0")) strAddressAction = "D";
        strAddressAction = "A";
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }
        #endregion

        #region "PHONE"
        foreach (GridViewRow row in this.grdPhone.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonPhone PersonPhoneATT = new ATTPersonPhone(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonPhoneATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonPhone.Add(PersonPhoneATT);
            }
        }
        #endregion

        #region "EMAIL"
        foreach (GridViewRow row in this.grdEMail.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonEMail PersonEMailATT = new ATTPersonEMail(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonEMailATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonEMail.Add(PersonEMailATT);
            }
        }
        #endregion


        //lstPerson.Add(objPerson);
        double PersonID = 0;
        if (this.txtPersonID.Text.Trim() != "")
        {
            PersonID = double.Parse(this.txtPersonID.Text.Trim());
        }

        lstPerson.Add(objPerson);
        if (lstPerson.Count > 0)
        {
            Session["MelMilaapKartaaInfo"] = lstPerson;
            // Session["PersonID"] = objPerson.PId;
            ClearControls();
            Response.Redirect("MelMilaapKartaa.aspx");
        }
        else
        {
            lblStatusMessage.Text = "Person List doesn't contain information";
            programmaticModalPopup.Show();
            return;
        }
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]);

        int    iniUnit          = 9;
        double empID            = 0;
        int    iniType          = 5;//Application ID
        int?   intCountryId     = null;
        int?   intBirthDistrict = null;
        int?   intReligion      = null;

        string strUser = "******"; //user.UserName;

        List <ATTPerson> PersonLST = new List <ATTPerson>();
        ATTPerson        objPerson = new ATTPerson();


        if (this.txtPersonID.Text.Trim() != "")
        {
            empID = double.Parse(this.txtPersonID.Text.Trim());
        }
        if (this.ddlCountry.SelectedIndex > 0)
        {
            intCountryId = int.Parse(this.ddlCountry.SelectedValue.ToString());
        }
        if (this.ddlBirthDistrict.SelectedIndex > 0)
        {
            intBirthDistrict = int.Parse(this.ddlBirthDistrict.SelectedValue.ToString());
        }
        if (this.ddlReligion.SelectedIndex > 0)
        {
            intReligion = int.Parse(this.ddlReligion.SelectedValue.ToString());
        }

        #region "PERSONTABLE"
        objPerson = new ATTPerson
                    (
            empID,
            this.txtFName_Rqd.Text.Trim(),
            this.txtMName.Text.Trim(),
            this.txtSurName_Rqd.Text.Trim(),
            this.txtDOB_DT.Text.Trim(),
            ((this.ddlGender.SelectedIndex <= 0) ? "" : (this.ddlGender.SelectedValue)),
            ((this.ddlMarStatus.SelectedIndex <= 0) ? "" : (this.ddlMarStatus.SelectedValue)),
            "",
            "",
            intCountryId,
            intBirthDistrict,
            intReligion,
            iniUnit,
            iniType,
            strUser,
            DateTime.Now,
            new byte[0]
                    );
        objPerson.FullName   = this.txtFName_Rqd.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim();
        objPerson.EntityType = "P";
        #endregion

        #region "ADDRESS"
        int?             intDistrictAddress = null;
        int?             intVDCAddress      = null;
        int?             intWardAddress     = null;
        string           strAddressAction   = "";
        ATTPersonAddress PersonAddressATT   = null;
        if (this.ddlDistrict.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrict.SelectedValue);
        }
        if (this.ddlVDC.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDC.SelectedValue);
        }
        if (this.ddlWard.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWard.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "P", int.Parse(hdnPerAddress.Value.ToString()), intDistrictAddress, intVDCAddress, intWardAddress, this.txtTole.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value != "0"))
        {
            strAddressAction = "E";
        }
        if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value == "0"))
        {
            strAddressAction = "A";
        }
        if (((this.ddlDistrict.SelectedIndex <= 0) && (this.txtTole.Text.Trim() == "")) && (hdnPerAddress.Value != "0"))
        {
            strAddressAction = "D";
        }
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }

        strAddressAction   = "";
        intDistrictAddress = null;
        intVDCAddress      = null;
        intWardAddress     = null;

        if (this.ddlDistrictTemp.SelectedIndex > 0)
        {
            intDistrictAddress = int.Parse(this.ddlDistrictTemp.SelectedValue);
        }
        if (this.ddlVDCTemp.SelectedIndex > 0)
        {
            intVDCAddress = int.Parse(this.ddlVDCTemp.SelectedValue);
        }
        if (this.ddlWardTemp.SelectedIndex > 0)
        {
            intWardAddress = int.Parse(this.ddlWardTemp.SelectedValue);
        }
        PersonAddressATT = new ATTPersonAddress
                           (
            0, "T", int.Parse(hdnTempAddress.Value.ToString()), intDistrictAddress, intVDCAddress, intWardAddress, this.txtToleTemp.Text.Trim(), "Y", strUser, DateTime.Now
                           );

        if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value != "0"))
        {
            strAddressAction = "E";
        }
        if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value == "0"))
        {
            strAddressAction = "A";
        }
        if (((this.ddlDistrictTemp.SelectedIndex <= 0) && (this.txtToleTemp.Text.Trim() == "")) && (hdnTempAddress.Value != "0"))
        {
            strAddressAction = "D";
        }
        if (strAddressAction != "")
        {
            PersonAddressATT.Action = strAddressAction;
            strAddressAction        = "";
            objPerson.LstPersonAddress.Add(PersonAddressATT);
        }
        #endregion

        #region "PHONE"
        foreach (GridViewRow row in this.grdPhone.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonPhone PersonPhoneATT = new ATTPersonPhone(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonPhoneATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonPhone.Add(PersonPhoneATT);
            }
        }
        #endregion

        #region "EMAIL"
        foreach (GridViewRow row in this.grdEMail.Rows)
        {
            if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "")
            {
                ATTPersonEMail PersonEMailATT = new ATTPersonEMail(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()),
                                                                   CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now);
                PersonEMailATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString());
                objPerson.LstPersonEMail.Add(PersonEMailATT);
            }
        }
        #endregion

        PersonLST.Add(objPerson);

        try
        {
            BLLPerson.SavePerson(PersonLST);

            this.ClearME();

            this.lblStatusMessage.Text = "Person has been saved successfully.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
    protected void btnAddSponsors_Click(object sender, EventArgs e)
    {
        if (ddlSponsors.SelectedIndex == 0)
        {
            this.lblStatus.Text        = "Add Sponsor Status";
            this.lblStatusMessage.Text = "Select Sponsor To Add";
            this.programmaticModalPopup.Show();
            return;
        }

        List <ATTProgramSponsor> PrgSponsorLST = new List <ATTProgramSponsor>();

        foreach (GridViewRow gvRow in grdSponsor.Rows)
        {
            ATTProgramSponsor objEPrgSponsor = new ATTProgramSponsor
                                               (
                0, 0,
                int.Parse(gvRow.Cells[0].Text),
                CheckNull.NullString(gvRow.Cells[4].Text),
                CheckNull.NulldblValue(gvRow.Cells[2].Text),
                CheckNull.NullString(gvRow.Cells[3].Text),
                "",
                CheckNull.NullString(gvRow.Cells[5].Text)
                                               );
            objEPrgSponsor.SponsorOBJ.SponsorName = gvRow.Cells[1].Text;
            PrgSponsorLST.Add(objEPrgSponsor);
        }


        if (grdSponsor.SelectedIndex == -1)
        {
            if (PrgSponsorLST.FindIndex(delegate(ATTProgramSponsor obj)
            {
                return(int.Parse(this.ddlSponsors.SelectedValue) == obj.SponsorID);
            }) > 0)
            {
                this.lblStatus.Text        = "Add Sponsor Status";
                this.lblStatusMessage.Text = "Sponsor Already Exists";
                this.programmaticModalPopup.Show();
                return;
            }

            ATTProgramSponsor objPrgSponsor = new ATTProgramSponsor(
                0, 0,
                int.Parse(this.ddlSponsors.SelectedValue),
                this.txtFromDate.Text,
                (this.txtBudget.Text == "") ? 0 : double.Parse(this.txtBudget.Text),
                (int.Parse(this.ddlCurrency.SelectedValue) == 0) ? "" : this.ddlCurrency.SelectedItem.Text,
                "",
                "A");
            objPrgSponsor.SponsorOBJ.SponsorName = this.ddlSponsors.SelectedItem.Text;
            PrgSponsorLST.Add(objPrgSponsor);
        }
        else
        {
            PrgSponsorLST[grdSponsor.SelectedIndex].Budget   = double.Parse(this.txtBudget.Text);
            PrgSponsorLST[grdSponsor.SelectedIndex].Currency = (this.ddlCurrency.SelectedValue == "0")?"":this.ddlCurrency.SelectedItem.Text;
            PrgSponsorLST[grdSponsor.SelectedIndex].FromDate = this.txtFromDate.Text;
            PrgSponsorLST[grdSponsor.SelectedIndex].Action   = (this.grdSponsor.SelectedRow.Cells[5].Text == "A") ? "A" : "E";
        }


        grdSponsor.DataSource = PrgSponsorLST;
        grdSponsor.DataBind();

        this.grdSponsor.SelectedIndex  = -1;
        this.ddlSponsors.SelectedIndex = -1;
        this.txtBudget.Text            = "";
        this.ddlCurrency.SelectedIndex = -1;
        this.txtFromDate.Text          = "";
    }