Exemplo n.º 1
0
 protected void ButtonDUserControl_Click(object sender, EventArgs e)
 {
     if (DropDownList7.SelectedValue == "DDL")
     {
         Response.Write(((DropDownList)PlaceHolder2.FindControl("DDL1")).SelectedItem + "<br/>");
     }
     else if (DropDownList7.SelectedValue == "TB")
     {
         Response.Write(((TextBox)PlaceHolder2.FindControl("TB1")).Text + "<br/>");
     }
 }
Exemplo n.º 2
0
    private SpeedSearchQuery BuildQuery()
    {
        var ssq = new SpeedSearchQuery {
            SearchText = SearchRequest.Text
        };

        if (string.IsNullOrEmpty(ssq.SearchText))
        {
            throw new UserObservableException(GetLocalResourceObject("SpeedSearch_Error_Keyword_Required").ToString());
        }
        ssq.SearchType       = SearchType.SelectedIndex;
        ssq.IncludeStemming  = SearchFlags.Items[0].Selected;
        ssq.IncludeThesaurus = SearchFlags.Items[1].Selected;
        ssq.IncludePhonic    = SearchFlags.Items[2].Selected;
        ssq.WhichPage        = _whichResultsPage;
        ssq.ItemsPerPage     = 10;
        _state.SelectedIndexes.Clear();
        for (var i = 0; i < _indexes.Count; i++)
        {
            var thisIndex = (CheckBox)PlaceHolder1.FindControl("Index" + i);
            if ((thisIndex != null) && (thisIndex.Checked))
            {
                ssq.Indexes.Add(new SpeedSearchIndex(_indexes[i].IndexName, _indexes[i].Type.Value, _indexes[i].IsSecure ?? false));
                _state.SelectedIndexes.Add(i);
            }
        }
        if (ssq.Indexes.Count == 0)
        {
            throw new UserObservableException(GetLocalResourceObject("SpeedSearch_Error_Index_Required").ToString());
        }
        var freqfilter = (CheckBox)PlaceHolder2.FindControl("FreqUsed");

        if ((freqfilter != null) && (freqfilter.Checked))
        {
            ssq.UseFrequentFilter = true;
        }
        foreach (var fd in _searchFilters.Values)
        {
            var filter = (TextBox)PlaceHolder2.FindControl(fd.DisplayName);
            if ((filter != null) && (!string.IsNullOrEmpty(filter.Text)))
            {
                ssq.Filters.Add(new SpeedSearchFilter(fd.DisplayName, filter.Text, fd.CommonIndexes, fd.FieldType, fd.IndexType));
            }
        }
        return(ssq);
    }
Exemplo n.º 3
0
        public void getDepressionScreeningData()
        {
            var PSM = new PatientScreeningManager();
            List <PatientScreening> screeningList = PSM.GetPatientScreeningByVisitId(PatientId, PmVisitId);

            //.GetPatientScreening(PatientId);
            if (screeningList != null)
            {
                foreach (var value in screeningList)
                {
                    depressionId = Convert.ToInt32(value.ScreeningTypeId);
                    RadioButtonList rblPC1Qs = (RadioButtonList)PlaceHolder1.FindControl("uds" + value.ScreeningCategoryId.ToString());
                    if (rblPC1Qs != null)
                    {
                        rblPC1Qs.SelectedValue = value.ScreeningValueId.ToString();
                    }
                    RadioButtonList rblPC2Qs = (RadioButtonList)PlaceHolder2.FindControl("uds" + value.ScreeningCategoryId.ToString());
                    if (rblPC2Qs != null)
                    {
                        rblPC2Qs.SelectedValue = value.ScreeningValueId.ToString();
                    }
                }
            }
            var PCN = new PatientClinicalNotesLogic();
            List <PatientClinicalNotes> notesList = PCN.getPatientClinicalNotesByVisitId(PatientId, PmVisitId);

            //.getPatientClinicalNotes(PatientId);
            if (notesList.Any())
            {
                foreach (var value in notesList)
                {
                    TextBox ntb = (TextBox)PlaceHolder2.FindControl("uds" + value.NotesCategoryId.ToString());
                    if (ntb != null)
                    {
                        ntb.Text = value.ClinicalNotes;
                    }
                }
            }
        }
Exemplo n.º 4
0
    //save dynamic values of sucategories
    protected void btnreadsub_Click(object sender, EventArgs e)
    {
        //save_performancetest();
        //retrieve_performancetest();
        int count = this.NumberOfControls1;
        int id    = Convert.ToInt32(ddperfcategory.SelectedValue);

        for (int i = 0; i < count; i++)
        {
            TextBox txsub = (TextBox)PlaceHolder2.FindControl("txtDatasub" + i.ToString());
            //Add the Controls to the container of your choice

            SqlConnection con = new SqlConnection(sqlcon);
            con.Open();
            SqlCommand cmd = new SqlCommand("insert into Perf_SubCategory(CategoryID,SubCategory_Name)values('" + id + "','" + txsub.Text.Trim().Replace("'", "''") + "')", con);
            cmd.ExecuteNonQuery();
            txsub.Text = "";
            ddperfcategory.Items.Clear();
        }
        string path1 = Page.Request.Url.AbsolutePath;

        Response.Redirect(path1);
    }
Exemplo n.º 5
0
    private SpeedSearchQuery BuildQuery()
    {
        SpeedSearchQuery ssq = new SpeedSearchQuery();

        ssq.SearchText       = SearchRequest.Text;
        ssq.SearchType       = SearchType.SelectedIndex;
        ssq.IncludeStemming  = SearchFlags.Items[0].Selected;
        ssq.IncludeThesaurus = SearchFlags.Items[1].Selected;
        ssq.IncludePhonic    = SearchFlags.Items[2].Selected;
        ssq.WhichPage        = whichResultsPage;
        ssq.ItemsPerPage     = 10;
        for (int i = 0; i < _Indexes.Count; i++)
        {
            CheckBox thisIndex = (CheckBox)PlaceHolder1.FindControl("Index" + i.ToString());
            if ((thisIndex != null) && (thisIndex.Checked))
            {
                ssq.Indexes.Add(_Indexes[i].IndexName);
                _State.SelectedIndexes.Add(i);
            }
        }
        CheckBox freqfilter = (CheckBox)PlaceHolder2.FindControl("FreqUsed");

        if ((freqfilter != null) && (freqfilter.Checked))
        {
            ssq.UseFrequentFilter = true;
        }
        foreach (SlxFieldDefinition fd in _SearchFilters.Values)
        {
            TextBox filter = (TextBox)PlaceHolder2.FindControl(fd.DisplayName);
            if ((filter != null) && (!string.IsNullOrEmpty(filter.Text)))
            {
                ssq.Filters.Add(new SpeedSearchFilter(fd.DisplayName, filter.Text, fd.CommonIndexes, fd.FieldType, fd.IndexType));
            }
        }
        return(ssq);
    }
Exemplo n.º 6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string        UpdateCommand = "update SAVINGS$ set CONTTOPENSION=@CONTTOPENSION, MEDICLAIM=@MEDICLAIM, HANDICAPPED=@HANDICAPPED, MEDICAL=@MEDICAL, EDULOAN=@EDULOAN, DONATION=@DONATION, PHDISABLED=@PHDISABLED, PUBLICPF=@PUBLICPF, HOUSELOAN=@HOUSELOAN, INTONHOUSELOAN=@INTONHOUSELOAN, INTONNSC=@INTONNSC, NSS=@NSS, MUTUALFUNDS=@MUTUALFUNDS, EQUITYLINK=@EQUITYLINK, TUTIONFEES=@TUTIONFEES, NSC=@NSC, LIC=@LIC, JEEVANSURAKSHA=@JEEVANSURAKSHA, LIPOSTAL=@LIPOSTAL, UNITLINK=@UNITLINK, MEP=@MEP, INVSTINFRA=@INVSTINFRA, OTHERS=@OTHERS, SEC80CCG=@SEC80CCG, SEC80DDB=@SEC80DDB, SEC80GG=@SEC80GG, SEC80GGC=@SEC80GGC, SEC80TTA=@SEC80TTA, SEC80U=@SEC80U, NPS=@NPS ";
            SqlConnection con           = con = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ToString());

            foreach (string s in Globals.DynamicControlsList1)
            {
                UpdateCommand = UpdateCommand + "," + s + "=@" + s;
            }
            foreach (string s in Globals.DynamicControlsList2)
            {
                UpdateCommand = UpdateCommand + "," + s + "=@" + s;
            }
            UpdateCommand = UpdateCommand + " where EMPNO=@EMPNO and SAVING_YEAR=@SAVING_YEAR";

            SqlCommand cmd1 = new SqlCommand(UpdateCommand, con);

            cmd1.Parameters.AddWithValue("@EMPNO", lblEmployeeNoValue.Text);
            cmd1.Parameters.AddWithValue("@SAVING_YEAR", lblSavingYearValue.Text);
            cmd1.Parameters.AddWithValue("@CONTTOPENSION", txtConToPension.Text);
            cmd1.Parameters.AddWithValue("@MEDICLAIM", txtMediPremium.Text);
            cmd1.Parameters.AddWithValue("@HANDICAPPED", txtHandicappedDepend.Text);
            cmd1.Parameters.AddWithValue("@MEDICAL", txtMediTreatment.Text);
            cmd1.Parameters.AddWithValue("@EDULOAN", txtRepayLoan.Text);
            cmd1.Parameters.AddWithValue("@DONATION", txtDonationCmrf.Text);
            cmd1.Parameters.AddWithValue("@PHDISABLED", txtBlindOrPh.Text);
            cmd1.Parameters.AddWithValue("@PUBLICPF", txtPPF.Text);
            cmd1.Parameters.AddWithValue("@HOUSELOAN", txtRepayHouseLoan.Text);
            cmd1.Parameters.AddWithValue("@INTONHOUSELOAN", txtInterestHouseLoan.Text);
            cmd1.Parameters.AddWithValue("@INTONNSC", txtAccureudInterestNSC.Text);
            cmd1.Parameters.AddWithValue("@NSS", txtNSS.Text);
            cmd1.Parameters.AddWithValue("@MUTUALFUNDS", txtMutualFund.Text);
            cmd1.Parameters.AddWithValue("@EQUITYLINK", txtEquityLinked.Text);
            cmd1.Parameters.AddWithValue("@TUTIONFEES", txtTutionFees.Text);
            cmd1.Parameters.AddWithValue("@NSC", txtNSC.Text);
            cmd1.Parameters.AddWithValue("@LIC", txtLicPremium.Text);
            cmd1.Parameters.AddWithValue("@JEEVANSURAKSHA", txtJeevanSuraksha.Text);
            cmd1.Parameters.AddWithValue("@LIPOSTAL", txtPostalInvestment.Text);
            cmd1.Parameters.AddWithValue("@UNITLINK", txtUnitInsurance.Text);
            cmd1.Parameters.AddWithValue("@MEP", txtInfrastructureBond.Text);
            cmd1.Parameters.AddWithValue("@INVSTINFRA", txtInvestmentInfrastructure.Text);
            cmd1.Parameters.AddWithValue("@OTHERS", txtOthers.Text);
            cmd1.Parameters.AddWithValue("@SEC80CCG", txtSec80CCG.Text);
            cmd1.Parameters.AddWithValue("@SEC80DDB", txtSec80DDB.Text);
            cmd1.Parameters.AddWithValue("@SEC80GG", txtSec80GG.Text);
            cmd1.Parameters.AddWithValue("@SEC80GGC", txtSec80GGC.Text);
            cmd1.Parameters.AddWithValue("@SEC80TTA", txtSec80TTA.Text);
            cmd1.Parameters.AddWithValue("@SEC80U", txtSec80U.Text);
            cmd1.Parameters.AddWithValue("@NPS", txtNPS.Text);

            foreach (string s in Globals.DynamicControlsList1)
            {
                //try
                //{
                cmd1.Parameters.AddWithValue("@" + s, (placeholder.FindControl("txt" + s) as TextBox).Text);
                //}
                //catch
                //{
                //    Response.Write("<script>alert('placeholder.FindControl: txt" +s + "');</script>");
                //}
            }
            foreach (string s in Globals.DynamicControlsList2)
            {
                //try
                //{
                cmd1.Parameters.AddWithValue("@" + s, (PlaceHolder2.FindControl("txt" + s) as TextBox).Text);
                //}
                //catch
                //{
                //    Response.Write("<script>alert('placeholder.FindControl: txt" + s + "');</script>");
                //}
            }
            con.Open();
            Response.Write("<script>alert('UPDATE COMMAND:" + UpdateCommand + "');</script>");
            int status = 0;

            status = cmd1.ExecuteNonQuery();
            con.Close();

            if (status == -1)
            {
                Response.Write("<script>alert('Error while saving data!!');</script>");
            }
            else
            {
                //Response.Write("<script>alert('Data Saved Successfully!!');</script>");
                //Response.Redirect("Savings.aspx");
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Data saved sucessfully');window.location ='Savings.aspx';", true);
            }
        }
Exemplo n.º 7
0
        //List<string> DynamicControlsList1;
        //List<string> DynamicControlsList2;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User_Id"] == null)
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (!IsPostBack)
            {
                String   value      = Request.QueryString.ToString();
                Char     delimiter  = '&';
                String[] substrings = value.Split(delimiter);
                if (substrings[0].StartsWith("EMPNO="))
                {
                    substrings[0] = substrings[0].Remove(0, "EMPNO=".Length);
                }
                if (substrings[1].StartsWith("SAVING_YEAR="))
                {
                    substrings[1] = substrings[1].Remove(0, "SAVING_YEAR=".Length);
                }

                Int16 Empid = 0, SavingYear = 0, id, year;
                if (Int16.TryParse(substrings[0], out id))
                {
                    Empid = id;
                }
                if (Int16.TryParse(substrings[1], out year))
                {
                    SavingYear = year;
                }

                Response.Write("<script>alert('empid=" + substrings[0] + " saving year=" + substrings[1] + "');</script>");
                lblEmployeeNoValue.Text = substrings[0];
                lblSavingYearValue.Text = substrings[1];

                DataSet ds = SetDataValues(Convert.ToInt16(substrings[0]), Convert.ToInt16(substrings[1]));

                txtConToPension.Text      = ds.Tables[0].Rows[0]["CONTTOPENSION"].ToString();
                txtMediPremium.Text       = ds.Tables[0].Rows[0]["MEDICLAIM"].ToString();
                txtHandicappedDepend.Text = ds.Tables[0].Rows[0]["HANDICAPPED"].ToString();
                txtMediTreatment.Text     = ds.Tables[0].Rows[0]["MEDICAL"].ToString();
                txtRepayLoan.Text         = ds.Tables[0].Rows[0]["EDULOAN"].ToString();
                txtDonationCmrf.Text      = ds.Tables[0].Rows[0]["DONATION"].ToString();
                txtBlindOrPh.Text         = ds.Tables[0].Rows[0]["PHDISABLED"].ToString();
                txtPPF.Text                      = ds.Tables[0].Rows[0]["PUBLICPF"].ToString();
                txtRepayHouseLoan.Text           = ds.Tables[0].Rows[0]["HOUSELOAN"].ToString();
                txtInterestHouseLoan.Text        = ds.Tables[0].Rows[0]["INTONHOUSELOAN"].ToString();
                txtAccureudInterestNSC.Text      = ds.Tables[0].Rows[0]["INTONNSC"].ToString();
                txtNSS.Text                      = ds.Tables[0].Rows[0]["NSS"].ToString();
                txtMutualFund.Text               = ds.Tables[0].Rows[0]["MUTUALFUNDS"].ToString();
                txtEquityLinked.Text             = ds.Tables[0].Rows[0]["EQUITYLINK"].ToString();
                txtTutionFees.Text               = ds.Tables[0].Rows[0]["TUTIONFEES"].ToString();
                txtNSC.Text                      = ds.Tables[0].Rows[0]["NSC"].ToString();
                txtLicPremium.Text               = ds.Tables[0].Rows[0]["LIC"].ToString();
                txtJeevanSuraksha.Text           = ds.Tables[0].Rows[0]["JEEVANSURAKSHA"].ToString();
                txtPostalInvestment.Text         = ds.Tables[0].Rows[0]["LIPOSTAL"].ToString();
                txtUnitInsurance.Text            = ds.Tables[0].Rows[0]["UNITLINK"].ToString();
                txtInfrastructureBond.Text       = ds.Tables[0].Rows[0]["MEP"].ToString();
                txtInvestmentInfrastructure.Text = ds.Tables[0].Rows[0]["INVSTINFRA"].ToString();
                txtOthers.Text                   = ds.Tables[0].Rows[0]["OTHERS"].ToString();
                txtSec80CCG.Text                 = ds.Tables[0].Rows[0]["SEC80CCG"].ToString();
                txtSec80DDB.Text                 = ds.Tables[0].Rows[0]["SEC80DDB"].ToString();
                txtSec80GG.Text                  = ds.Tables[0].Rows[0]["SEC80GG"].ToString();
                txtSec80GGC.Text                 = ds.Tables[0].Rows[0]["SEC80GGC"].ToString();
                txtSec80TTA.Text                 = ds.Tables[0].Rows[0]["SEC80TTA"].ToString();
                txtSec80U.Text                   = ds.Tables[0].Rows[0]["SEC80U"].ToString();
                txtNPS.Text                      = ds.Tables[0].Rows[0]["NPS"].ToString();

                foreach (string s in Globals.DynamicControlsList1)
                {
                    (placeholder.FindControl("txt" + s) as TextBox).Text = ds.Tables[0].Rows[0][s].ToString();
                }
                foreach (string s in Globals.DynamicControlsList2)
                {
                    (PlaceHolder2.FindControl("txt" + s) as TextBox).Text = ds.Tables[0].Rows[0][s].ToString();
                }
            }
        }
        protected void txtEmpNo_TextChanged(object sender, EventArgs e)
        {
            int           previousYear = DateTime.Now.Year - 1;
            SqlConnection con          = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ToString());
            SqlCommand    cmd          = new SqlCommand("select * from SAVINGS$ where SAVING_YEAR=@SAVING_YEAR and EMPNO=@EMPNO", con);

            cmd.Parameters.AddWithValue("@SAVING_YEAR", previousYear);
            cmd.Parameters.AddWithValue("@EMPNO", txtEmpNo.Text);
            con.Open();
            SqlDataReader rdr = cmd.ExecuteReader();

            if (rdr.Read())
            {
                //txtEmpNo.Text = rdr["EMPNO"].ToString();
                txtConToPension.Text      = rdr["CONTTOPENSION"].ToString();
                txtMediPremium.Text       = rdr["MEDICLAIM"].ToString();
                txtHandicappedDepend.Text = rdr["HANDICAPPED"].ToString();
                txtMediTreatment.Text     = rdr["MEDICAL"].ToString();
                txtRepayLoan.Text         = rdr["EDULOAN"].ToString();
                txtDonationCmrf.Text      = rdr["DONATION"].ToString();
                txtBlindOrPh.Text         = rdr["PHDISABLED"].ToString();
                txtPPF.Text                      = rdr["PUBLICPF"].ToString();
                txtRepayHouseLoan.Text           = rdr["HOUSELOAN"].ToString();
                txtInterestHouseLoan.Text        = rdr["INTONHOUSELOAN"].ToString();
                txtAccureudInterestNSC.Text      = rdr["INTONNSC"].ToString();
                txtNSS.Text                      = rdr["NSS"].ToString();
                txtMutualFund.Text               = rdr["MUTUALFUNDS"].ToString();
                txtEquityLinked.Text             = rdr["EQUITYLINK"].ToString();
                txtTutionFees.Text               = rdr["TUTIONFEES"].ToString();
                txtNSC.Text                      = rdr["NSC"].ToString();
                txtLicPremium.Text               = rdr["LIC"].ToString();
                txtJeevanSuraksha.Text           = rdr["JEEVANSURAKSHA"].ToString();
                txtPostalInvestment.Text         = rdr["LIPOSTAL"].ToString();
                txtUnitInsurance.Text            = rdr["UNITLINK"].ToString();
                txtInfrastructureBond.Text       = rdr["MEP"].ToString();
                txtInvestmentInfrastructure.Text = rdr["INVSTINFRA"].ToString();
                txtOthers.Text                   = rdr["OTHERS"].ToString();
                txtSec80CCG.Text                 = rdr["SEC80CCG"].ToString();
                txtSec80DDB.Text                 = rdr["SEC80DDB"].ToString();
                txtSec80GG.Text                  = rdr["SEC80GG"].ToString();
                txtSec80GGC.Text                 = rdr["SEC80GGC"].ToString();
                txtSec80TTA.Text                 = rdr["SEC80TTA"].ToString();
                txtSec80U.Text                   = rdr["SEC80U"].ToString();
                txtNPS.Text                      = rdr["NPS"].ToString();
                foreach (string s in DynamicControlsList)
                {
                    (placeholder.FindControl("txt" + s) as TextBox).Text = rdr[s].ToString();
                }
                foreach (string s in DynamicControlsList)
                {
                    (PlaceHolder2.FindControl("txt" + s) as TextBox).Text = rdr[s].ToString();
                }
            }
            else
            {
                //txtEmpNo.Text = "0";
                ddlSavingsYear.SelectedIndex = 0;
                txtConToPension.Text         = "0";
                txtMediPremium.Text          = "0";
                txtHandicappedDepend.Text    = "0";
                txtMediTreatment.Text        = "0";
                txtRepayLoan.Text            = "0";
                txtDonationCmrf.Text         = "0";
                txtBlindOrPh.Text            = "0";
                txtPPF.Text                      = "0";
                txtRepayHouseLoan.Text           = "0";
                txtInterestHouseLoan.Text        = "0";
                txtAccureudInterestNSC.Text      = "0";
                txtNSS.Text                      = "0";
                txtMutualFund.Text               = "0";
                txtEquityLinked.Text             = "0";
                txtTutionFees.Text               = "0";
                txtNSC.Text                      = "0";
                txtLicPremium.Text               = "0";
                txtJeevanSuraksha.Text           = "0";
                txtPostalInvestment.Text         = "0";
                txtUnitInsurance.Text            = "0";
                txtInfrastructureBond.Text       = "0";
                txtInvestmentInfrastructure.Text = "0";
                txtOthers.Text                   = "0";
                txtSec80CCG.Text                 = "0";
                txtSec80DDB.Text                 = "0";
                txtSec80GG.Text                  = "0";
                txtSec80GGC.Text                 = "0";
                txtSec80TTA.Text                 = "0";
                txtSec80U.Text                   = "0";
                txtNPS.Text                      = "0";

                foreach (string s in DynamicControlsList)
                {
                    (placeholder.FindControl("txt" + s) as TextBox).Text = "0";
                }
                foreach (string s in DynamicControlsList)
                {
                    (PlaceHolder2.FindControl("txt" + s) as TextBox).Text = "0";
                }
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //string InsertCommand = "insert into SAVINGS$ values (@EMPNO,@SAVING_YEAR,@CONTTOPENSION,@MEDICLAIM,@HANDICAPPED,@MEDICAL,@EDULOAN,@DONATION,@PHDISABLED,@PUBLICPF,@HOUSELOAN,@INTONHOUSELOAN,@INTONNSC,@NSS,@MUTUALFUNDS,@EQUITYLINK,@TUTIONFEES,@NSC,@LIC,@JEEVANSURAKSHA,@LIPOSTAL,@UNITLINK,@MEP,@INVSTINFRA,@OTHERS";
                string InsertCommand = "insert into SAVINGS$(EMPNO, SAVING_YEAR, CONTTOPENSION, MEDICLAIM, HANDICAPPED, MEDICAL, EDULOAN, DONATION, PHDISABLED, PUBLICPF, HOUSELOAN, INTONHOUSELOAN, INTONNSC, NSS, MUTUALFUNDS, EQUITYLINK, TUTIONFEES, NSC, LIC, JEEVANSURAKSHA, LIPOSTAL, UNITLINK, MEP, INVSTINFRA, OTHERS, SEC80CCG, SEC80DDB, SEC80GG, SEC80GGC, SEC80TTA, SEC80U, NPS";

                //80C SECTIONS
                SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ToString());
                SqlCommand    cmd = new SqlCommand("select * from SECTIONS", con); //SECTIONS=80C SECTIONS
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();

                List <string> ControlList1    = new List <string>();
                String        controlsNames1  = "";
                String        controlsValues1 = "";

                while (rdr.Read())
                {
                    string ControlName = (string)rdr["NAME"];
                    ControlName = ControlName.Replace(" ", "");
                    //InsertCommand = InsertCommand + ",@" + ControlName;
                    controlsNames1  = controlsNames1 + "," + ControlName;
                    controlsValues1 = controlsValues1 + ",@" + ControlName;
                    ControlList1.Add(ControlName);
                }

                rdr.Close();
                con.Close();


                // SAVINGS SECTIONS
                String controlsNames2  = "";
                String controlsValues2 = "";
                cmd = new SqlCommand("SELECT * FROM SAVINGS_SECTIONS$ WHERE NAME != '80C'", con);
                con.Open();
                rdr = cmd.ExecuteReader();

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

                while (rdr.Read())
                {
                    string ControlName = (string)rdr["NAME"];
                    ControlName = ControlName.Replace(" ", "");
                    //InsertCommand = InsertCommand + ",@" + ControlName;
                    controlsNames2  = controlsNames2 + "," + ControlName;
                    controlsValues2 = controlsValues2 + ",@" + ControlName;
                    ControlList2.Add(ControlName);
                }

                rdr.Close();
                con.Close();

                InsertCommand = InsertCommand + controlsNames1 + controlsNames2 + ") values(@EMPNO,@SAVING_YEAR,@CONTTOPENSION,@MEDICLAIM,@HANDICAPPED,@MEDICAL,@EDULOAN,@DONATION,@PHDISABLED,@PUBLICPF,@HOUSELOAN,@INTONHOUSELOAN,@INTONNSC,@NSS,@MUTUALFUNDS,@EQUITYLINK,@TUTIONFEES,@NSC,@LIC,@JEEVANSURAKSHA,@LIPOSTAL,@UNITLINK,@MEP,@INVSTINFRA,@OTHERS, @SEC80CCG, @SEC80DDB, @SEC80GG, @SEC80GGC, @SEC80TTA, @SEC80U, @NPS" + controlsValues1 + controlsValues2 + ")";
                //InsertCommand = InsertCommand + ")";

                con.Open();
                //Response.Write("<script>alert('INSERT CMD= " + InsertCommand + "');</script>");
                //Response.Write("<script>alert('CONTTOPENSION= "+txtConToPension.Text+ " MEDICLAIM="+ txtMediPremium.Text+"');</script>");
                SqlCommand cmd1 = new SqlCommand(InsertCommand, con);

                cmd1.Parameters.AddWithValue("@EMPNO", txtEmpNo.Text);
                cmd1.Parameters.AddWithValue("@SAVING_YEAR", ddlSavingsYear.SelectedValue);
                cmd1.Parameters.AddWithValue("@CONTTOPENSION", txtConToPension.Text);
                cmd1.Parameters.AddWithValue("@MEDICLAIM", txtMediPremium.Text);
                cmd1.Parameters.AddWithValue("@HANDICAPPED", txtHandicappedDepend.Text);
                cmd1.Parameters.AddWithValue("@MEDICAL", txtMediTreatment.Text);
                cmd1.Parameters.AddWithValue("@EDULOAN", txtRepayLoan.Text);
                cmd1.Parameters.AddWithValue("@DONATION", txtDonationCmrf.Text);
                cmd1.Parameters.AddWithValue("@PHDISABLED", txtBlindOrPh.Text);
                cmd1.Parameters.AddWithValue("@PUBLICPF", txtPPF.Text);
                cmd1.Parameters.AddWithValue("@HOUSELOAN", txtRepayHouseLoan.Text);
                cmd1.Parameters.AddWithValue("@INTONHOUSELOAN", txtInterestHouseLoan.Text);
                cmd1.Parameters.AddWithValue("@INTONNSC", txtAccureudInterestNSC.Text);
                cmd1.Parameters.AddWithValue("@NSS", txtNSS.Text);
                cmd1.Parameters.AddWithValue("@MUTUALFUNDS", txtMutualFund.Text);
                cmd1.Parameters.AddWithValue("@EQUITYLINK", txtEquityLinked.Text);
                cmd1.Parameters.AddWithValue("@TUTIONFEES", txtTutionFees.Text);
                cmd1.Parameters.AddWithValue("@NSC", txtNSC.Text);
                cmd1.Parameters.AddWithValue("@LIC", txtLicPremium.Text);
                cmd1.Parameters.AddWithValue("@JEEVANSURAKSHA", txtJeevanSuraksha.Text);
                cmd1.Parameters.AddWithValue("@LIPOSTAL", txtPostalInvestment.Text);
                cmd1.Parameters.AddWithValue("@UNITLINK", txtUnitInsurance.Text);
                cmd1.Parameters.AddWithValue("@MEP", txtInfrastructureBond.Text);
                cmd1.Parameters.AddWithValue("@INVSTINFRA", txtInvestmentInfrastructure.Text);
                cmd1.Parameters.AddWithValue("@OTHERS", txtOthers.Text);
                cmd1.Parameters.AddWithValue("@SEC80CCG", txtSec80CCG.Text);
                cmd1.Parameters.AddWithValue("@SEC80DDB", txtSec80DDB.Text);
                cmd1.Parameters.AddWithValue("@SEC80GG", txtSec80GG.Text);
                cmd1.Parameters.AddWithValue("@SEC80GGC", txtSec80GGC.Text);
                cmd1.Parameters.AddWithValue("@SEC80TTA", txtSec80TTA.Text);
                cmd1.Parameters.AddWithValue("@SEC80U", txtSec80U.Text);
                cmd1.Parameters.AddWithValue("@NPS", txtNPS.Text);

                foreach (string s in ControlList1)
                {
                    cmd1.Parameters.AddWithValue("@" + s, (placeholder.FindControl("txt" + s) as TextBox).Text);
                }

                foreach (string s in ControlList2)
                {
                    cmd1.Parameters.AddWithValue("@" + s, (PlaceHolder2.FindControl("txt" + s) as TextBox).Text);
                }
                Response.Write("<script>alert('INSERT COMMAND:" + InsertCommand + "');</script>");
                int status = 0;
                status = cmd1.ExecuteNonQuery();
                con.Close();

                if (status == -1)
                {
                    Response.Write("<script>alert('Error while saving data!!');</script>");
                }
                else
                {
                    //Response.Write("<script>alert('Data Saved Successfully!!');</script>");
                    //Response.Redirect("Savings.aspx");
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Data saved sucessfully');window.location ='Savings.aspx';", true);
                }
                //Response.Redirect("Savings.aspx");
            }
            catch (Exception ee)
            {
                Response.Write("<script>alert('Error while saving data!!');</script>");
            }
        }
Exemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ImageButton1.Visible = false;

        con.Open();
        SqlCommand cmd5 = new SqlCommand("select tsize from tbltheatre where tname='" + Session["tname"].ToString() + "'", con);

        tsize = Convert.ToInt16(cmd5.ExecuteScalar());
        //SqlCommand cmd6 = new SqlCommand("select ttcost from tbltheatre where tname='")

        // cmd6 =new  SqlDataAdapter("select tsize,ttcost from tbltheatre where tname='" + Session["tname"].ToString() + "'", con);
        //DataSet ds2 = new DataSet();
        //cmd6.Fill(ds2);

        //tsize = Convert.ToInt16(ds2.Tables[0].Rows[0]["tsize"].ToString());

        SqlCommand cmd6 = new SqlCommand("select ttcost from tbltheatre where tname='" + Session["tname"].ToString() + "'", con);

        tcost       = Convert.ToInt16(cmd6.ExecuteScalar());
        Label1.Text = "Ticket Cost Rs. " + tcost.ToString();
        // Label1.Text ="Ticket Cost RS "+ ds2.Tables[0].Rows[0]["ttcost"].ToString()+"/";

        s = tsize / 5;

        int i, j, k, l, m, n, o, p, q, r;


        for (i = 1; i <= s; i++)
        {
            CheckBox ch = new CheckBox();
            ch.ID   = i.ToString();
            ch.Text = i.ToString();

            PlaceHolder1.Controls.Add(ch);
        }
        for (j = i; j <= s + s; j++)
        {
            CheckBox ch1 = new CheckBox();
            ch1.ID   = j.ToString();
            ch1.Text = j.ToString();
            PlaceHolder2.Controls.Add(ch1);
        }
        for (k = j; k <= s + s + s; k++)
        {
            CheckBox ch2 = new CheckBox();
            ch2.ID   = k.ToString();
            ch2.Text = k.ToString();
            PlaceHolder3.Controls.Add(ch2);
        }

        for (l = k; l <= s + s + s + s; l++)
        {
            CheckBox ch3 = new CheckBox();
            ch3.ID   = l.ToString();
            ch3.Text = l.ToString();
            PlaceHolder4.Controls.Add(ch3);
        }
        for (m = l; m <= s + s + s + s + s; m++)
        {
            CheckBox ch4 = new CheckBox();
            ch4.ID   = m.ToString();
            ch4.Text = m.ToString();
            PlaceHolder5.Controls.Add(ch4);
        }



        string u = "";

        SqlDataAdapter da = new SqlDataAdapter("select nooftickets, seatno from tblbooking where tname='" + Session["tname"].ToString() + "'  and mname='" + Request.QueryString["mname"].ToString() + "' and showdate='" + Session["bdate"].ToString() + "' and showtime='" + Session["stime"].ToString() + "'", con);
        DataSet        ds = new DataSet();

        da.Fill(ds);


        int rcount = ds.Tables[0].Rows.Count;

        if (rcount > 0)
        {
            rcount = rcount - 1;
            while (rcount >= 0)
            {
                u = ds.Tables[0].Rows[rcount][1].ToString();
                //string u = "32,55,1,4,8";
                string[] a = u.Split(new char[] { ',' });

                int b, c, d, f, z, y;
                for (y = 0; y <= a.Length - 1; y++)
                {
                    for (z = 1; z <= s; z++)
                    {
                        CheckBox lc = (CheckBox)PlaceHolder1.FindControl(z.ToString());
                        if (lc.Text == a[y])
                        {
                            lc.Enabled = false;
                        }
                    }


                    for (b = z; b <= s + s; b++)
                    {
                        CheckBox lc1 = (CheckBox)PlaceHolder2.FindControl(b.ToString());
                        if (lc1.Text == a[y])
                        {
                            lc1.Enabled = false;
                        }
                    }
                    for (c = b; c <= s + s + s; c++)
                    {
                        CheckBox lc2 = (CheckBox)PlaceHolder3.FindControl(c.ToString());
                        if (lc2.Text == a[y])
                        {
                            lc2.Enabled = false;
                        }
                    }
                    for (d = c; d <= s + s + s + s; d++)
                    {
                        CheckBox lc3 = (CheckBox)PlaceHolder4.FindControl(d.ToString());
                        if (lc3.Text == a[y])
                        {
                            lc3.Enabled = false;
                        }
                    }
                    for (f = d; f <= s + s + s + s + s; f++)
                    {
                        CheckBox lc4 = (CheckBox)PlaceHolder5.FindControl(f.ToString());
                        if (lc4.Text == a[y])
                        {
                            lc4.Enabled = false;
                        }
                    }
                }

                rcount = rcount - 1;
            }
        }
        con.Close();
    }
Exemplo n.º 11
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        con.Open();
        SqlDataAdapter cmd5 = new SqlDataAdapter("select tsize,ttcost from tbltheatre where tname='" + Session["tname"].ToString() + "'", con);
        DataSet        ds1  = new DataSet();

        cmd5.Fill(ds1);

        tsize = Convert.ToInt16(ds1.Tables[0].Rows[0]["tsize"].ToString());
        //tcost = Convert.ToInt16(ds1.Tables[0].Rows[0]["ttcost"].ToString());
        s = tsize / 5;

        int    ss  = 0;
        string sno = "";
        //int s = 100 / 5;
        int b, c, d, f, z, y;

        for (z = 1; z <= s; z++)
        {
            CheckBox lc = (CheckBox)PlaceHolder1.FindControl(z.ToString());
            if (lc.Checked == true)
            {
                ss++;
                if (ss <= 5)
                {
                    sno = lc.Text + "," + sno;
                }
            }

            if (ss > 5)
            {
                lc.Checked = false;
            }
        }

        for (b = z; b <= s + s; b++)
        {
            CheckBox lc1 = (CheckBox)PlaceHolder2.FindControl(b.ToString());
            if (lc1.Checked == true)
            {
                ss++;
                if (ss <= 5)
                {
                    sno = sno + "," + lc1.Text;
                }
            }

            if (ss > 5)
            {
                lc1.Checked = false;
            }
        }

        for (c = b; c <= s + s + s; c++)
        {
            CheckBox lc2 = (CheckBox)PlaceHolder3.FindControl(c.ToString());
            if (lc2.Checked == true)
            {
                ss++;
                if (ss <= 5)
                {
                    sno = sno + "," + lc2.Text;
                }
            }

            if (ss > 5)
            {
                lc2.Checked = false;
            }
        }
        for (d = c; d <= s + s + s + s; d++)
        {
            CheckBox lc3 = (CheckBox)PlaceHolder4.FindControl(d.ToString());
            if (lc3.Checked == true)
            {
                ss++;
                if (ss <= 5)
                {
                    sno = sno + "," + lc3.Text;
                }
            }

            if (ss > 5)
            {
                lc3.Checked = false;
            }
        }
        for (f = d; f <= s + s + s + s + s; f++)
        {
            CheckBox lc4 = (CheckBox)PlaceHolder5.FindControl(f.ToString());
            if (lc4.Checked == true)
            {
                ss++;
                if (ss <= 5)
                {
                    sno = sno + "," + lc4.Text;
                }
            }

            if (ss > 5)
            {
                lc4.Checked = false;
            }
        }
        if (ss > 5 || ss == 0)
        {
            Response.Write("<script>alert('Select less than or Equal to 5 seats')</script>");
        }
        if (ss <= 5 && ss > 0)
        {
            tcst = ss * Convert.ToInt16(ds1.Tables[0].Rows[0]["ttcost"].ToString());

            string id = Session["uname"].ToString() + DateTime.Now;
            string bookid;
            bookid = id.Replace(":", "a");
            bookid = bookid.Replace("-", "b");
            bookid = bookid.Replace(" ", "c");

            SqlCommand cmd = new SqlCommand("insert into tblbooking values('" + Session["uname"].ToString() + "','" + Session["tname"].ToString() + "','" + Request.QueryString["mname"].ToString() + "','" + Session["bdate"].ToString() + "','" + Session["stime"].ToString() + "'," + ss + ",'" + sno + "'," + tcst + ",'" + bookid + "')", con);

            if (cmd.ExecuteNonQuery() > 0)
            {
                //SqlDataAdapter da4 = new SqlDataAdapter("select * from tblbooking where bookid =(select max(bookid) from tblbooking)", con);
                SqlDataAdapter da4 = new SqlDataAdapter("select * from tblbooking where bookid ='" + bookid + "'", con);

                DataSet ds4 = new DataSet();
                da4.Fill(ds4);
                DetailsView1.DataSource = ds4;
                DetailsView1.DataBind();
                Response.Write("<script>alert('Booking Successfull ')</script>");
                ImageButton1.Visible = true;
            }
            else
            {
                Response.Write("<script>alert('Error')</script>");
            }
        }
        con.Close();
    }