Esempio n. 1
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     PopulateHospitalId();
     testidhidden.Value = e.CommandArgument.ToString();
     if (e.CommandName == "U")
     {
         MultiView1.ActiveViewIndex = 0;
         btnsave.Text   = "Update";
         db1.strCommand = "Select * from AddCalibrationTest where ActiveStatus='True' and TestID='" + testidhidden.Value + "'";
         DataTable dt = db1.selecttable();
         if (dt.Rows.Count > 0)
         {
             txttestname.Text   = dt.Rows[0]["TestName"].ToString();
             txtdescrption.Text = dt.Rows[0]["Description"].ToString();
         }
     }
     if (e.CommandName == "D")
     {
         string query = "Update AddCalibrationTest set ActiveStatus='False' where TestID='" + testidhidden.Value + "'";
         db1.executeQuery(query);
         BindGrid();
         lblmsg.Text = "Deleted Successfully";
         lblmsg.Style.Add("color", "green");
     }
 }
Esempio n. 2
0
    public void GridBind()
    {
        dt_result.Columns.Add("ReportNo", typeof(string));
        dt_result.Columns.Add("Date_of_calibration", typeof(string));
        dt_result.Columns.Add("Calibration_Due_on", typeof(string));
        dt_result.Columns.Add("HospitalName", typeof(string));
        dt_result.Columns.Add("Instrument", typeof(string));
        dt_result.Columns.Add("Perf_TestName", typeof(string));
        dt_trace.Columns.Add("Instrument", typeof(string));
        dt_perf.Columns.Add("Perf_TestName", typeof(string));

        db1.strCommand = "select rp.ReportNo,rp.Date_of_calibration,rp.Calibration_Due_on,hp.HospitalName,rp.Tracibility_ID, " +
                         "rp.PerfID from Report_Info rp inner join Hospital hp on rp.HospitalID=hp.HospitalID";

        dt = db1.selecttable();
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                TraceBind();
                PerfID();
                dt_result.Rows.Add(dt.Rows[i]["ReportNo"].ToString(), dt.Rows[i]["Date_of_calibration"].ToString(),
                                   dt.Rows[i]["Calibration_Due_on"].ToString(), dt.Rows[i]["HospitalName"].ToString(),
                                   dt_trace, dt_perf);
            }
            GridView1.DataSource = dt_result;
            GridView1.DataBind();
            DataList1.DataSource = dt_result;
            DataList1.DataBind();
        }
    }
Esempio n. 3
0
 public void retreiveReportID(string barcodeid)
 {
     if (usertype == "2")
     {
         db1.strCommand = "select rp.Report_info_ID from Report_Info as rp inner join " +
                          "Customer_Info as cu on cu.Report_info_ID=rp.Report_info_ID where rp.ReportNo='" + barcodeid + "'" +
                          "and cu.HospitalID='" + hospid + "'";
         DataTable dt = new DataTable();
         dt = db1.selecttable();
         if (dt.Rows.Count > 0)
         {
             reportid_hidden.Value = (dt.Rows[0]["Report_info_ID"].ToString());
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid Report Number ');", true);
         }
     }
     else
     {
         db1.strCommand = "select Report_info_ID from Report_Info where ReportNo='" + barcodeid + "'";
         DataTable dt = new DataTable();
         dt = db1.selecttable();
         if (dt.Rows.Count > 0)
         {
             reportid_hidden.Value = (dt.Rows[0]["Report_info_ID"].ToString());
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid Barcode ID!');", true);
         }
     }
 }
Esempio n. 4
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        save_performancetest();
        int count = this.NumberOfControls1;

        for (int i = 0; i < count; i++)
        {
            TextBox txcat     = (TextBox)PlaceHolder1.FindControl("txtData" + i.ToString());
            TextBox txsubcat  = (TextBox)PlaceHolder1.FindControl("txtsubData" + i.ToString());
            TextBox txsubcat1 = (TextBox)PlaceHolder1.FindControl("txtsubData_1" + i.ToString());
            TextBox txsubcat2 = (TextBox)PlaceHolder1.FindControl("txtsubData_2" + i.ToString());
            TextBox txsubcat3 = (TextBox)PlaceHolder1.FindControl("txtsubData_3" + i.ToString());
            TextBox txsubcat4 = (TextBox)PlaceHolder1.FindControl("txtsubData_4" + i.ToString());
            TextBox txsubcat5 = (TextBox)PlaceHolder1.FindControl("txtsubData_5" + i.ToString());
            TextBox txsubcat6 = (TextBox)PlaceHolder1.FindControl("txtsubData_6" + i.ToString());


            //Add the Controls to the container of your choice


            perf_valueHidden.Value = txcat.Text.Trim().Replace("'", "''") + "," + txsubcat.Text.Trim().Replace("'", "''") + "," +
                                     txsubcat1.Text.Trim().Replace("'", "''") + "," + txsubcat2.Text.Trim().Replace("'", "''") + "," +
                                     txsubcat3.Text.Trim().Replace("'", "''") + "," + txsubcat4.Text.Trim().Replace("'", "''") + "," +
                                     txsubcat5.Text.Trim().Replace("'", "''") + "," + txsubcat6.Text.Trim().Replace("'", "''") + ",";
            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value) values('" + Session["perfid"].ToString() + "','" + perf_valueHidden.Value + "')";
            db1.insertqry();
            txcat.Text     = "";
            txsubcat.Text  = "";
            txsubcat1.Text = "";
            txsubcat2.Text = "";
            txsubcat3.Text = "";
            txsubcat4.Text = "";
            txsubcat5.Text = "";
            txsubcat6.Text = "";
        }

        db1.strCommand = "select Top " + count + " ValueID from Performance_Values order by ValueID desc";
        DataTable dt_valueid = db1.selecttable();

        if (dt_valueid.Rows.Count > 0)
        {
            for (int i = 0; i < count; i++)
            {
                db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID)values('" + Session["PerfID"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "')";
                db1.insertqry();
            }
        }
        Removetextbox();
        btnadd.Focus();
    }
Esempio n. 5
0
    public void BindProduct()
    {
        db1.strCommand = "select * from Product order by ProductName Asc";
        DataTable dt = db1.selecttable();

        drpproduct.Items.Clear();
        if (dt.Rows.Count > 0)
        {
            drpproduct.DataSource     = dt;
            drpproduct.DataTextField  = "ProductName";
            drpproduct.DataValueField = "ProductID";
            drpproduct.DataBind();
        }
        drpproduct.Items.Insert(0, "--Select Product--");
    }
Esempio n. 6
0
    //select perfid and test name from table for binding dropdownlist of performance test.
    public void select_perftest_name()
    {
        db1.strCommand = "select PerfID,Perf_TestName from PerformanceTest";
        DataTable dt = db1.selecttable();

        ddperftest.Items.Clear();
        if (dt.Rows.Count > 0)
        {
            ddperftest.DataSource     = dt;
            ddperftest.DataTextField  = "Perf_TestName";
            ddperftest.DataValueField = "PerfID";
            ddperftest.DataBind();
        }
        ddperftest.Items.Insert(0, "--select Performance Test--");
    }
Esempio n. 7
0
 protected void grdPrevention_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         ListBox     lstcalibration       = (ListBox)e.Row.FindControl("lstcalibration");
         HiddenField HiddenFieldPreventID = (HiddenField)e.Row.FindControl("HiddenFieldPreventID");
         int         preventid            = Convert.ToInt32(HiddenFieldPreventID.Value);
         db.strCommand = "Select ct.TestID,ct.TestName from AddCalibrationTest ct inner join Prevent_Join_Calibration pjc on " +
                         " ct.TestID=pjc.TestID where pjc.PreventID='" + preventid + "' and ct.ActiveStatus=1";
         DataTable dt = db.selecttable();
         lstcalibration.DataSource     = dt;
         lstcalibration.DataTextField  = "TestName";
         lstcalibration.DataValueField = "TestID";
         lstcalibration.DataBind();
     }
 }
 public void PopulateHospitalId()
 {
     if (usertype == "2")
     {
         db1.strCommand = "select HospitalID from Hospital hp " +
                          "inner join LoginTb lg on lg.LoginID=hp.LoginID where lg.Username='******' ";
         //hospid.Text=db1.executescalar();
         DataTable dt = db1.selecttable();
         if (dt.Rows.Count > 0)
         {
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 idhospitalhidden.Value = dt.Rows[0]["HospitalID"].ToString();
             }
         }
     }
 }
Esempio n. 9
0
    public void Bind_ampliHolter(string sReportid, string sPerfid)
    {
        amplitude_holterid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    amplitudeholtertr1++;
                    string[]      ampliholterarray1 = { };
                    StringBuilder sb_ampliholter1   = new StringBuilder();
                    sb_ampliholter1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_ampliholter1.ToString();
                    ampliholterarray1 = perfvalue1.Split(',');
                    if (ampliholterarray1.Count() > 0)
                    {
                        if (ampliholterarray1[0].ToString() != "")
                        {
                            lblampliholter1.Text = ampliholterarray1[0].ToString();
                        }
                        if (ampliholterarray1[1].ToString() != "")
                        {
                            lblampliholter2.Text = ampliholterarray1[1].ToString();
                        }
                        if (ampliholterarray1[2].ToString() != "")
                        {
                            lblampliholter3.Text = ampliholterarray1[2].ToString();
                        }
                        if (ampliholterarray1[3].ToString() != "")
                        {
                            lblampliholter4.Text = ampliholterarray1[3].ToString();
                        }
                        if (ampliholterarray1[4].ToString() != "")
                        {
                            lblampliholter5.Text = ampliholterarray1[4].ToString();
                        }
                        if (ampliholterarray1[5].ToString() != "")
                        {
                            lblampliholter6.Text = ampliholterarray1[5].ToString();
                        }
                        if (ampliholterarray1[6].ToString() != "")
                        {
                            lblampliholter7.Text = ampliholterarray1[6].ToString();
                        }
                    }
                }
            }
        }
    }
    public void Bind_Luxmeasure(string sReportid, string sPerfid)
    {
        luxid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    luxmeastr1++;
                    string[]      luxarray1 = { };
                    StringBuilder sb_lux1   = new StringBuilder();
                    sb_lux1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_lux1.ToString();
                    luxarray1 = perfvalue1.Split(',');
                    if (luxarray1.Count() > 0)
                    {
                        if (luxarray1[0].ToString() != "")
                        {
                            lbllux1.Text = luxarray1[0].ToString();
                        }
                        if (luxarray1[1].ToString() != "")
                        {
                            lbllux2.Text = luxarray1[1].ToString();
                        }
                        if (luxarray1[2].ToString() != "")
                        {
                            lbllux3.Text = luxarray1[2].ToString();
                        }
                        if (luxarray1[3].ToString() != "")
                        {
                            lbllux4.Text = luxarray1[3].ToString();
                        }
                        if (luxarray1[4].ToString() != "")
                        {
                            lbllux5.Text = luxarray1[4].ToString();
                        }
                        if (luxarray1[5].ToString() != "")
                        {
                            lbllux6.Text = luxarray1[5].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 11
0
    public void Bind_PressureAutoclave(string sReportid, string sPerfid)
    {
        pressure_atclaveid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    pratclavetr1++;
                    string[]      pratclavearray1 = { };
                    StringBuilder sb_pratclave1   = new StringBuilder();
                    sb_pratclave1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_pratclave1.ToString();
                    pratclavearray1 = perfvalue1.Split(',');
                    if (pratclavearray1.Count() > 0)
                    {
                        if (pratclavearray1[0].ToString() != "")
                        {
                            lblpratclave1.Text = pratclavearray1[0].ToString();
                        }
                        if (pratclavearray1[1].ToString() != "")
                        {
                            lblpratclave2.Text = pratclavearray1[1].ToString();
                        }
                        if (pratclavearray1[2].ToString() != "")
                        {
                            lblpratclave3.Text = pratclavearray1[2].ToString();
                        }
                        if (pratclavearray1[3].ToString() != "")
                        {
                            lblpratclave4.Text = pratclavearray1[3].ToString();
                        }
                        if (pratclavearray1[4].ToString() != "")
                        {
                            lblpratclave5.Text = pratclavearray1[4].ToString();
                        }
                        if (pratclavearray1[5].ToString() != "")
                        {
                            lblpratclave6.Text = pratclavearray1[5].ToString();
                        }
                    }
                }
            }
        }
    }
    public void Bind_temphygro(string sReportid, string sPerfid)
    {
        temphygroid1++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];
            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    temphygrotr1++;
                    string[]      temphygroarray1 = { };
                    StringBuilder sb_temphygro1   = new StringBuilder();
                    sb_temphygro1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_temphygro1.ToString();
                    temphygroarray1 = perfvalue1.Split(',');
                    if (temphygroarray1.Count() > 0)
                    {
                        if (temphygroarray1[0].ToString() != "")
                        {
                            lbltemphygro1.Text = temphygroarray1[0].ToString();
                        }
                        if (temphygroarray1[1].ToString() != "")
                        {
                            lbltemphygro2.Text = temphygroarray1[1].ToString();
                        }
                        if (temphygroarray1[2].ToString() != "")
                        {
                            lbltemphygro3.Text = temphygroarray1[2].ToString();
                        }
                        if (temphygroarray1[3].ToString() != "")
                        {
                            lbltemphygro4.Text = temphygroarray1[3].ToString();
                        }
                        if (temphygroarray1[4].ToString() != "")
                        {
                            lbltemphygro5.Text = temphygroarray1[4].ToString();
                        }
                        if (temphygroarray1[5].ToString() != "")
                        {
                            lbltemphygro6.Text = temphygroarray1[5].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 13
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        if (btnsave.Text == "Save")
        {
            db1.strCommand = "select Model from Product where ProductName like '" + txtproname.Text.Trim() + "' and " +
                             "Company like '" + txtmanu.Text.Trim() + "' and Model like '" + txtmodel.Text.Trim() + "'";
            DataTable dt = db1.selecttable();
            if (dt.Rows.Count <= 0)
            {
                db1.strCommand = "insert into Product(ProductName,Company,Model,Device_Type,Device_Classification,Supply,PowerRating)values " +
                                 "('" + txtproname.Text.Trim().Replace("'", "''") + "','" + txtmanu.Text.Trim().Replace("'", "''") + "','" + txtmodel.Text.Trim().Replace("'", "''") + "'," +
                                 "'" + txtdevtype.Text.Trim().Replace("'", "''") + "','" + txtdevclassification.Text.Trim().Replace("'", "''") + "','" + txtsupplydata.Text.Trim().Replace("'", "''") + "'," +
                                 "'" + txtpower.Text.Trim().Replace("'", "''") + "')";
                db1.insertqry();
                GridProductBind();
                clearfield();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Model Name already exists !');", true);
            }
        }

        else if (btnsave.Text == "Update")
        {
            db1.strCommand = "update Product set ProductName='" + txtproname.Text.Trim().Replace("'", "''") + "'," +
                             "Company='" + txtmanu.Text.Trim().Replace("'", "''") + "',Model='" + txtmodel.Text.Trim().Replace("'", "''") + "'," +
                             "Device_Type='" + txtdevtype.Text.Trim().Replace("'", "''") + "',Device_Classification='" + txtdevclassification.Text.Trim().Replace("'", "''") + "'," +
                             "Supply='" + txtsupplydata.Text.Trim().Replace("'", "''") + "',PowerRating='" + txtpower.Text.Trim().Replace("'", "''") + "'" +
                             " where ProductID='" + productidhidden.Value + "'";
            db1.insertqry();
            GridProductBind();
            btnsave.Text = "Save";
            clearfield();
        }
    }
Esempio n. 14
0
    public void BindHospitalDetails()
    {
        string username = Page.User.Identity.Name;

        db.strCommand = "select h.HospitalName,h.Address,h.HospitalID from LoginTb l inner join Hospital h  on l.LoginID=h.LoginID " +
                        " where l.Username='******'";
        DataTable dt = db.selecttable();

        if (dt.Rows.Count > 0)
        {
            lblHospitalName.Text   = dt.Rows[0]["HospitalName"].ToString();
            lblAddress.Text        = dt.Rows[0]["Address"].ToString();
            hospitalidhidden.Value = dt.Rows[0]["HospitalID"].ToString();
        }
    }
Esempio n. 15
0
    public void Bind_flow(string sReportid, string sPerfid)
    {
        flowid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];
            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    flowtr1++;
                    string[]      flowarray1 = { };
                    StringBuilder sb_flow1   = new StringBuilder();
                    sb_flow1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_flow1.ToString();
                    flowarray1 = perfvalue1.Split(',');
                    if (flowarray1.Count() > 0)
                    {
                        if (flowarray1[0].ToString() != "")
                        {
                            lblflow1.Text = flowarray1[0].ToString();
                        }
                        if (flowarray1[1].ToString() != "")
                        {
                            lblflow2.Text = flowarray1[1].ToString();
                        }
                        if (flowarray1[3].ToString() != "")
                        {
                            lblflow5.Text = flowarray1[3].ToString();
                        }
                        if (flowarray1[4].ToString() != "")
                        {
                            lblflow6.Text = flowarray1[4].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 16
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            if (edit_Reportid == "" || edit_Reportid == null)
            {
                for (int i = 0; i < 2; i++)
                {
                    if (i == 0)
                    {
                        flow_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtdut1.Text.Trim().Replace("'", "''") + "," +
                                            txtstd1.Text.Trim().Replace("'", "''") + "," + txtval1.Text.Trim().Replace("'", "''") + "," +
                                            txtalodev1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid55"].ToString() + "','" + flow_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }

                lblmsg.Text = "Data Inserted Successfully";
                lblmsg.Style.Add("color", "green");
            }
            else
            {
                db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='" + edit_Reportid + "' and PerfID='55'";
                DataTable dt_valueid = db1.selecttable();
                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_valueid.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            flow_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtdut1.Text.Trim().Replace("'", "''") + "," +
                                                txtstd1.Text.Trim().Replace("'", "''") + "," + txtval1.Text.Trim().Replace("'", "''") + "," +
                                                txtalodev1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");

                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid55"].ToString() + "','" + flow_hidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 2; i++)
                    {
                        if (i == 0)
                        {
                            flow_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtdut1.Text.Trim().Replace("'", "''") + "," +
                                                txtstd1.Text.Trim().Replace("'", "''") + "," + txtval1.Text.Trim().Replace("'", "''") + "," +
                                                txtalodev1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid55"].ToString() + "','" + flow_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }

                lblmsg.Text = "Data Updated Successfully";
                lblmsg.Style.Add("color", "green");
            }
        }
        catch (Exception ex)
        {
            lblmsg.Text = "Data not Inserted Successfully " + ex;
            lblmsg.Style.Add("color", "red");
        }
    }
Esempio n. 17
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            if (edit_Reportid == "" || edit_Reportid == null)
            {
                for (int i = 0; i < 7; i++)
                {
                    if (i == 0)
                    {
                        syntime_hidden.Value = txtlam1.Text.Trim();
                        db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 1)
                    {
                        syntime_hidden.Value = txtlam2.Text.Trim();
                        db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 2)
                    {
                        syntime_hidden.Value = txtlam3.Text.Trim();
                        db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 3)
                    {
                        syntime_hidden.Value = txtlam4.Text.Trim();
                        db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 4)
                    {
                        syntime_hidden.Value = txtlam5.Text.Trim();
                        db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 5)
                    {
                        syntime_hidden.Value = txtlam6.Text.Trim();
                        db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 6)
                    {
                        syntime_hidden.Value = txtlam7.Text.Trim();
                        db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }

                lblmsg.Text = "Data Inserted Successfully";
                lblmsg.Style.Add("color", "green");
            }
            else
            {
                db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='" + edit_Reportid + "' and PerfID='56'";
                DataTable dt_valueid = db1.selecttable();
                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < 7; i++)
                    {
                        if (i == 0)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            syntime_hidden.Value = txtlam1.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            syntime_hidden.Value = txtlam2.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            syntime_hidden.Value = txtlam3.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 3)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            syntime_hidden.Value = txtlam4.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 4)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            syntime_hidden.Value = txtlam5.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 5)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            syntime_hidden.Value = txtlam6.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 6)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            syntime_hidden.Value = txtlam7.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 7; i++)
                    {
                        if (i == 0)
                        {
                            syntime_hidden.Value = txtlam1.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            syntime_hidden.Value = txtlam2.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            syntime_hidden.Value = txtlam3.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 3)
                        {
                            syntime_hidden.Value = txtlam4.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 4)
                        {
                            syntime_hidden.Value = txtlam5.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 5)
                        {
                            syntime_hidden.Value = txtlam6.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 6)
                        {
                            syntime_hidden.Value = txtlam7.Text.Trim();
                            db1.strCommand       = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid56"].ToString() + "','" + syntime_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }

                lblmsg.Text = "Data Updated Successfully";
                lblmsg.Style.Add("color", "green");
            }
        }
        catch (Exception ex)
        {
            lblmsg.Text = "Data not Inserted Successfully" + ex;
            lblmsg.Style.Add("color", "red");
        }
    }
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            if (edit_Reportid == "" || edit_Reportid == null)
            {
                save_performancetest();
                for (int i = 0; i < 3; i++)
                {
                    if (i == 0)
                    {
                        temp_fluidwarmer_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtdut1.Text.Trim().Replace("'", "''") + "," +
                                                        txttp1_1.Text.Trim().Replace("'", "''") + "," + txttp2_1.Text.Trim().Replace("'", "''") + "," + txttp3_1.Text.Trim().Replace("'", "''") + "," +
                                                        txttp4_1.Text.Trim().Replace("'", "''") + "," + txttp5_1.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                        txtdev1.Text.Trim().Replace("'", "''") + "," + txtspec1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 1)
                    {
                        temp_fluidwarmer_hidden.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtdut2.Text.Trim().Replace("'", "''") + "," +
                                                        txttp1_2.Text.Trim().Replace("'", "''") + "," + txttp2_2.Text.Trim().Replace("'", "''") + "," + txttp3_2.Text.Trim().Replace("'", "''") + "," +
                                                        txttp4_2.Text.Trim().Replace("'", "''") + "," + txttp5_2.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                        txtdev2.Text.Trim().Replace("'", "''") + "," + txtspec2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 2)
                    {
                        temp_fluidwarmer_hidden.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtdut3.Text.Trim().Replace("'", "''") + "," +
                                                        txttp1_3.Text.Trim().Replace("'", "''") + "," + txttp2_3.Text.Trim().Replace("'", "''") + "," + txttp3_3.Text.Trim().Replace("'", "''") + "," +
                                                        txttp4_3.Text.Trim().Replace("'", "''") + "," + txttp5_3.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                        txtdev3.Text.Trim().Replace("'", "''") + "," + txtspec3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }
                db1.strCommand = "select Top 3 ValueID from Performance_Values order by ValueID desc";
                DataTable dt_valueid = db1.selecttable();

                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid18"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }
                lblmsg.Text = "Data Inserted Successfully";
                lblmsg.Style.Add("color", "green");
            }
            else
            {
                save_performancetest();
                db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='" + edit_Reportid + "' and PerfID='18'";
                DataTable dt_valueid = db1.selecttable();
                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_valueid.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            temp_fluidwarmer_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtdut1.Text.Trim().Replace("'", "''") + "," +
                                                            txttp1_1.Text.Trim().Replace("'", "''") + "," + txttp2_1.Text.Trim().Replace("'", "''") + "," + txttp3_1.Text.Trim().Replace("'", "''") + "," +
                                                            txttp4_1.Text.Trim().Replace("'", "''") + "," + txttp5_1.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                            txtdev1.Text.Trim().Replace("'", "''") + "," + txtspec1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid18"].ToString() + "',Perf_Value='" + temp_fluidwarmer_hidden.Value + "'" +
                            //     " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            temp_fluidwarmer_hidden.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtdut2.Text.Trim().Replace("'", "''") + "," +
                                                            txttp1_2.Text.Trim().Replace("'", "''") + "," + txttp2_2.Text.Trim().Replace("'", "''") + "," + txttp3_2.Text.Trim().Replace("'", "''") + "," +
                                                            txttp4_2.Text.Trim().Replace("'", "''") + "," + txttp5_2.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                            txtdev2.Text.Trim().Replace("'", "''") + "," + txtspec2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid18"].ToString() + "',Perf_Value='" + temp_fluidwarmer_hidden.Value + "'" +
                            //     " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            temp_fluidwarmer_hidden.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtdut3.Text.Trim().Replace("'", "''") + "," +
                                                            txttp1_3.Text.Trim().Replace("'", "''") + "," + txttp2_3.Text.Trim().Replace("'", "''") + "," + txttp3_3.Text.Trim().Replace("'", "''") + "," +
                                                            txttp4_3.Text.Trim().Replace("'", "''") + "," + txttp5_3.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                            txtdev3.Text.Trim().Replace("'", "''") + "," + txtspec3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid18"].ToString() + "',Perf_Value='" + temp_fluidwarmer_hidden.Value + "'" +
                            //     " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                    if (dt_valueid.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt_valueid.Rows.Count; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid18"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 3; i++)
                    {
                        if (i == 0)
                        {
                            temp_fluidwarmer_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtdut1.Text.Trim().Replace("'", "''") + "," +
                                                            txttp1_1.Text.Trim().Replace("'", "''") + "," + txttp2_1.Text.Trim().Replace("'", "''") + "," + txttp3_1.Text.Trim().Replace("'", "''") + "," +
                                                            txttp4_1.Text.Trim().Replace("'", "''") + "," + txttp5_1.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                            txtdev1.Text.Trim().Replace("'", "''") + "," + txtspec1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            temp_fluidwarmer_hidden.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtdut2.Text.Trim().Replace("'", "''") + "," +
                                                            txttp1_2.Text.Trim().Replace("'", "''") + "," + txttp2_2.Text.Trim().Replace("'", "''") + "," + txttp3_2.Text.Trim().Replace("'", "''") + "," +
                                                            txttp4_2.Text.Trim().Replace("'", "''") + "," + txttp5_2.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                            txtdev2.Text.Trim().Replace("'", "''") + "," + txtspec2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            temp_fluidwarmer_hidden.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtdut3.Text.Trim().Replace("'", "''") + "," +
                                                            txttp1_3.Text.Trim().Replace("'", "''") + "," + txttp2_3.Text.Trim().Replace("'", "''") + "," + txttp3_3.Text.Trim().Replace("'", "''") + "," +
                                                            txttp4_3.Text.Trim().Replace("'", "''") + "," + txttp5_3.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                            txtdev3.Text.Trim().Replace("'", "''") + "," + txtspec3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid18"].ToString() + "','" + temp_fluidwarmer_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                    db1.strCommand = "select Top 3 ValueID from Performance_Values order by ValueID desc";
                    DataTable dt_valueidupdate = db1.selecttable();

                    if (dt_valueidupdate.Rows.Count > 0)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid18"].ToString() + "','" + dt_valueidupdate.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }

                lblmsg.Text = "Data Updated Successfully";
                lblmsg.Style.Add("color", "green");
            }
        }
        catch
        {
            lblmsg.Text = "Data not Inserted Successfully";
            lblmsg.Style.Add("color", "red");
        }
    }
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            if (edit_Reportid == "" || edit_Reportid == null)
            {
                save_performancetest();
                for (int i = 0; i < 3; i++)
                {
                    if (i == 0)
                    {
                        acctest_stringehidden.Value = txtslno1.Text.Trim().Replace("'", "''") + "," + txtstddut1.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt1.Text.Trim().Replace("'", "''") + "," + txtinstnt2.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt3.Text.Trim().Replace("'", "''") + "," + txtinstnt4.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt5.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                      txtdevml1.Text.Trim().Replace("'", "''") + "," +
                                                      txtspec1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 1)
                    {
                        acctest_stringehidden.Value = txtslno2.Text.Trim().Replace("'", "''") + "," + txtdutstd2.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt6.Text.Trim().Replace("'", "''") + "," + txtinstnt7.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt8.Text.Trim().Replace("'", "''") + "," + txtinstnt9.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt10.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                      txtdevml2.Text.Trim().Replace("'", "''") + "," +
                                                      txtspec2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 2)
                    {
                        acctest_stringehidden.Value = txtslno3.Text.Trim().Replace("'", "''") + "," + txtstddut3.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt11.Text.Trim().Replace("'", "''") + "," + txtinstnt12.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt13.Text.Trim().Replace("'", "''") + "," + txtinstnt14.Text.Trim().Replace("'", "''") + "," +
                                                      txtinstnt15.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                      txtdevml3.Text.Trim().Replace("'", "''") + "," +
                                                      txtspec3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }

                db1.strCommand = "select Top 3 ValueID from Performance_Values order by ValueID desc";
                DataTable dt_valueid = db1.selecttable();

                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid46"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }
                lblmsg.Text = "Data Inserted Successfully";
                lblmsg.Style.Add("color", "green");
            }
            else
            {
                save_performancetest();
                db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='" + edit_Reportid + "' and PerfID='46'";
                DataTable dt_valueid = db1.selecttable();
                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_valueid.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            acctest_stringehidden.Value = txtslno1.Text.Trim().Replace("'", "''") + "," + txtstddut1.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt1.Text.Trim().Replace("'", "''") + "," + txtinstnt2.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt3.Text.Trim().Replace("'", "''") + "," + txtinstnt4.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt5.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                          txtdevml1.Text.Trim().Replace("'", "''") + "," +
                                                          txtspec1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");

                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid46"].ToString() + "',Perf_Value='" + acctest_stringehidden.Value + "'" +
                            //    " where Report_info_ID='" + edit_Reportid + "' and ValueID='"+dt_valueid.Rows[i]["ValueID"].ToString()+"'";
                            //db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            acctest_stringehidden.Value = txtslno2.Text.Trim().Replace("'", "''") + "," + txtdutstd2.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt6.Text.Trim().Replace("'", "''") + "," + txtinstnt7.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt8.Text.Trim().Replace("'", "''") + "," + txtinstnt9.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt10.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                          txtdevml2.Text.Trim().Replace("'", "''") + "," +
                                                          txtspec2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid46"].ToString() + "',Perf_Value='" + acctest_stringehidden.Value + "'" +
                            //    " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            acctest_stringehidden.Value = txtslno3.Text.Trim().Replace("'", "''") + "," + txtstddut3.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt11.Text.Trim().Replace("'", "''") + "," + txtinstnt12.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt13.Text.Trim().Replace("'", "''") + "," + txtinstnt14.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt15.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                          txtdevml3.Text.Trim().Replace("'", "''") + "," +
                                                          txtspec3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid46"].ToString() + "',Perf_Value='" + acctest_stringehidden.Value + "'" +
                            //    " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                    if (dt_valueid.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt_valueid.Rows.Count; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid46"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 3; i++)
                    {
                        if (i == 0)
                        {
                            acctest_stringehidden.Value = txtslno1.Text.Trim().Replace("'", "''") + "," + txtstddut1.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt1.Text.Trim().Replace("'", "''") + "," + txtinstnt2.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt3.Text.Trim().Replace("'", "''") + "," + txtinstnt4.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt5.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                          txtdevml1.Text.Trim().Replace("'", "''") + "," +
                                                          txtspec1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            acctest_stringehidden.Value = txtslno2.Text.Trim().Replace("'", "''") + "," + txtdutstd2.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt6.Text.Trim().Replace("'", "''") + "," + txtinstnt7.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt8.Text.Trim().Replace("'", "''") + "," + txtinstnt9.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt10.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                          txtdevml2.Text.Trim().Replace("'", "''") + "," +
                                                          txtspec2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            acctest_stringehidden.Value = txtslno3.Text.Trim().Replace("'", "''") + "," + txtstddut3.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt11.Text.Trim().Replace("'", "''") + "," + txtinstnt12.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt13.Text.Trim().Replace("'", "''") + "," + txtinstnt14.Text.Trim().Replace("'", "''") + "," +
                                                          txtinstnt15.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                          txtdevml3.Text.Trim().Replace("'", "''") + "," +
                                                          txtspec3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid46"].ToString() + "','" + acctest_stringehidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }

                    db1.strCommand = "select Top 3 ValueID from Performance_Values order by ValueID desc";
                    DataTable dt_valueidupdate = db1.selecttable();

                    if (dt_valueidupdate.Rows.Count > 0)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid46"].ToString() + "','" + dt_valueidupdate.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                //db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='"+edit_Reportid+"'";
                //DataTable dt_valueid = db1.selecttable();


                lblmsg.Text = "Data Updated Successfully";
                lblmsg.Style.Add("color", "green");
            }
        }
        catch
        {
            lblmsg.Text = "Data not Inserted Correctly";
            lblmsg.Style.Add("color", "red");
        }
    }
Esempio n. 20
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            if (edit_Reportid == "" || edit_Reportid == null)
            {
                save_performancetest();
                for (int i = 0; i < 6; i++)
                {
                    if (i == 0)
                    {
                        PerformanceAnalysisAnasthesia.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtpara1.Text.Trim().Replace("'", "''") + "," +
                                                              txtstddut1.Text.Trim().Replace("'", "''") + "," + txtavgstd1.Text.Trim().Replace("'", "''") + "," +
                                                              txtdev1.Text.Trim().Replace("'", "''") + "," + txtalodev1.Text.Trim().Replace("'", "''") + "," +
                                                              txtrem1.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 1)
                    {
                        PerformanceAnalysisAnasthesia.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtpara2.Text.Trim().Replace("'", "''") + "," +
                                                              txtstddut2.Text.Trim().Replace("'", "''") + "," + txtavgstd2.Text.Trim().Replace("'", "''") + "," +
                                                              txtdev2.Text.Trim().Replace("'", "''") + "," + txtalodev2.Text.Trim().Replace("'", "''") + "," +
                                                              txtrem2.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 2)
                    {
                        PerformanceAnalysisAnasthesia.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtpara3.Text.Trim().Replace("'", "''") + "," +
                                                              txtstddut3.Text.Trim().Replace("'", "''") + "," + txtavgstd3.Text.Trim().Replace("'", "''") + "," +
                                                              txtdev3.Text.Trim().Replace("'", "''") + "," + txtalodev3.Text.Trim().Replace("'", "''") + "," +
                                                              txtrem3.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 3)
                    {
                        PerformanceAnalysisAnasthesia.Value = txtsl4.Text.Trim().Replace("'", "''") + "," + txtpara4.Text.Trim().Replace("'", "''") + "," +
                                                              txtstddut4.Text.Trim().Replace("'", "''") + "," + txtavgstd4.Text.Trim().Replace("'", "''") + "," +
                                                              txtdev4.Text.Trim().Replace("'", "''") + "," + txtalodev4.Text.Trim().Replace("'", "''") + "," +
                                                              txtrem4.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 4)
                    {
                        PerformanceAnalysisAnasthesia.Value = txtsl5.Text.Trim().Replace("'", "''") + "," + txtpara5.Text.Trim().Replace("'", "''") + "," +
                                                              txtstddut5.Text.Trim().Replace("'", "''") + "," + txtavgstd5.Text.Trim().Replace("'", "''") + "," +
                                                              txtdev5.Text.Trim().Replace("'", "''") + "," + txtalodev5.Text.Trim().Replace("'", "''") + "," +
                                                              txtrem5.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 5)
                    {
                        PerformanceAnalysisAnasthesia.Value = txtsl6.Text.Trim().Replace("'", "''") + "," + txtpara6.Text.Trim().Replace("'", "''") + "," +
                                                              txtstddut6.Text.Trim().Replace("'", "''") + "," + txtavgstd6.Text.Trim().Replace("'", "''") + "," +
                                                              txtdev6.Text.Trim().Replace("'", "''") + "," + txtalodev6.Text.Trim().Replace("'", "''") + "," +
                                                              txtrem6.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }
                db1.strCommand = "select Top 6 ValueID from Performance_Values order by ValueID desc";
                DataTable dt_valueid = db1.selecttable();

                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < 6; i++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid11"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }
                lblmsg.Text = "Data Inserted Successfully";
                lblmsg.Style.Add("color", "green");
            }
            else
            {
                save_performancetest();
                db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='" + edit_Reportid + "' and PerfID='11'";
                DataTable dt_valueid = db1.selecttable();
                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_valueid.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            PerformanceAnalysisAnasthesia.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtpara1.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut1.Text.Trim().Replace("'", "''") + "," + txtavgstd1.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev1.Text.Trim().Replace("'", "''") + "," + txtalodev1.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem1.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid11"].ToString() + "',Perf_Value='" + PerformanceAnalysisAnasthesia.Value + "'" +
                            //        " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //    db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            PerformanceAnalysisAnasthesia.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtpara2.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut2.Text.Trim().Replace("'", "''") + "," + txtavgstd2.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev2.Text.Trim().Replace("'", "''") + "," + txtalodev2.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem2.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid11"].ToString() + "',Perf_Value='" + PerformanceAnalysisAnasthesia.Value + "'" +
                            //        " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //    db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            PerformanceAnalysisAnasthesia.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtpara3.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut3.Text.Trim().Replace("'", "''") + "," + txtavgstd3.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev3.Text.Trim().Replace("'", "''") + "," + txtalodev3.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem3.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid11"].ToString() + "',Perf_Value='" + PerformanceAnalysisAnasthesia.Value + "'" +
                            //        " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //    db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 3)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            PerformanceAnalysisAnasthesia.Value = txtsl4.Text.Trim().Replace("'", "''") + "," + txtpara4.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut4.Text.Trim().Replace("'", "''") + "," + txtavgstd4.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev4.Text.Trim().Replace("'", "''") + "," + txtalodev4.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem4.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid11"].ToString() + "',Perf_Value='" + PerformanceAnalysisAnasthesia.Value + "'" +
                            //        " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //    db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 4)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            PerformanceAnalysisAnasthesia.Value = txtsl5.Text.Trim().Replace("'", "''") + "," + txtpara5.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut5.Text.Trim().Replace("'", "''") + "," + txtavgstd5.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev5.Text.Trim().Replace("'", "''") + "," + txtalodev5.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem5.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid11"].ToString() + "',Perf_Value='" + PerformanceAnalysisAnasthesia.Value + "'" +
                            //        " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //    db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 5)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            PerformanceAnalysisAnasthesia.Value = txtsl6.Text.Trim().Replace("'", "''") + "," + txtpara6.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut6.Text.Trim().Replace("'", "''") + "," + txtavgstd6.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev6.Text.Trim().Replace("'", "''") + "," + txtalodev6.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem6.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid11"].ToString() + "',Perf_Value='" + PerformanceAnalysisAnasthesia.Value + "'" +
                            //        " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //    db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                    if (dt_valueid.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt_valueid.Rows.Count; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid11"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 6; i++)
                    {
                        if (i == 0)
                        {
                            PerformanceAnalysisAnasthesia.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtpara1.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut1.Text.Trim().Replace("'", "''") + "," + txtavgstd1.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev1.Text.Trim().Replace("'", "''") + "," + txtalodev1.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem1.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            PerformanceAnalysisAnasthesia.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtpara2.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut2.Text.Trim().Replace("'", "''") + "," + txtavgstd2.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev2.Text.Trim().Replace("'", "''") + "," + txtalodev2.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem2.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            PerformanceAnalysisAnasthesia.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtpara3.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut3.Text.Trim().Replace("'", "''") + "," + txtavgstd3.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev3.Text.Trim().Replace("'", "''") + "," + txtalodev3.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem3.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 3)
                        {
                            PerformanceAnalysisAnasthesia.Value = txtsl4.Text.Trim().Replace("'", "''") + "," + txtpara4.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut4.Text.Trim().Replace("'", "''") + "," + txtavgstd4.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev4.Text.Trim().Replace("'", "''") + "," + txtalodev4.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem4.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 4)
                        {
                            PerformanceAnalysisAnasthesia.Value = txtsl5.Text.Trim().Replace("'", "''") + "," + txtpara5.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut5.Text.Trim().Replace("'", "''") + "," + txtavgstd5.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev5.Text.Trim().Replace("'", "''") + "," + txtalodev5.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem5.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 5)
                        {
                            PerformanceAnalysisAnasthesia.Value = txtsl6.Text.Trim().Replace("'", "''") + "," + txtpara6.Text.Trim().Replace("'", "''") + "," +
                                                                  txtstddut6.Text.Trim().Replace("'", "''") + "," + txtavgstd6.Text.Trim().Replace("'", "''") + "," +
                                                                  txtdev6.Text.Trim().Replace("'", "''") + "," + txtalodev6.Text.Trim().Replace("'", "''") + "," +
                                                                  txtrem6.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid11"].ToString() + "','" + PerformanceAnalysisAnasthesia.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                    db1.strCommand = "select Top 6 ValueID from Performance_Values order by ValueID desc";
                    DataTable dt_valueidupdate = db1.selecttable();

                    if (dt_valueidupdate.Rows.Count > 0)
                    {
                        for (int i = 0; i < 6; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid11"].ToString() + "','" + dt_valueidupdate.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }

                lblmsg.Text = "Data Updated Successfully";
                lblmsg.Style.Add("color", "green");
            }
        }
        catch
        {
            lblmsg.Text = "Data not Inserted Successfully";
            lblmsg.Style.Add("color", "red");
        }
    }
    public void Bind_Temptest_flashcycle(string sReportid, string sPerfid)
    {
        temp_flashcycleid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    flashtr1++;
                    string[]      flasharray1 = { };
                    StringBuilder sb_flash1   = new StringBuilder();
                    sb_flash1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_flash1.ToString();
                    flasharray1 = perfvalue1.Split(',');
                    if (flasharray1.Count() > 0)
                    {
                        if (flasharray1[0].ToString() != "")
                        {
                            lblflash1.Text = flasharray1[0].ToString();
                        }
                        if (flasharray1[1].ToString() != "")
                        {
                            lblflash2.Text = flasharray1[1].ToString();
                        }
                        if (flasharray1[2].ToString() != "")
                        {
                            lblflash3.Text = flasharray1[2].ToString();
                        }
                        if (flasharray1[3].ToString() != "")
                        {
                            lblflash4.Text = flasharray1[3].ToString();
                        }
                        if (flasharray1[4].ToString() != "")
                        {
                            lblflash5.Text = flasharray1[4].ToString();
                        }
                        if (flasharray1[5].ToString() != "")
                        {
                            lblflash6.Text = flasharray1[5].ToString();
                        }
                        if (flasharray1[6].ToString() != "")
                        {
                            lblflash7.Text = flasharray1[6].ToString();
                        }
                        if (flasharray1[7].ToString() != "")
                        {
                            lblflash8.Text = flasharray1[7].ToString();
                        }
                        if (flasharray1[8].ToString() != "")
                        {
                            lblflash9.Text = flasharray1[8].ToString();
                        }
                        if (flasharray1[9].ToString() != "")
                        {
                            lblflash10.Text = flasharray1[9].ToString();
                        }
                        if (flasharray1[10].ToString() != "")
                        {
                            lblflash11.Text = flasharray1[10].ToString();
                        }
                    }
                }
                if (j == 1)
                {
                    flashtr2++;
                    string[]      flasharray2 = { };
                    StringBuilder sb_flash2   = new StringBuilder();
                    sb_flash2.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_flash2.ToString();
                    flasharray2 = perfvalue1.Split(',');
                    if (flasharray2.Count() > 0)
                    {
                        if (flasharray2[0].ToString() != "")
                        {
                            lblflash12.Text = flasharray2[0].ToString();
                        }
                        if (flasharray2[1].ToString() != "")
                        {
                            lblflash13.Text = flasharray2[1].ToString();
                        }
                        if (flasharray2[2].ToString() != "")
                        {
                            lblflash14.Text = flasharray2[2].ToString();
                        }
                        if (flasharray2[3].ToString() != "")
                        {
                            lblflash15.Text = flasharray2[3].ToString();
                        }
                        if (flasharray2[4].ToString() != "")
                        {
                            lblflash16.Text = flasharray2[4].ToString();
                        }
                        if (flasharray2[5].ToString() != "")
                        {
                            lblflash17.Text = flasharray2[5].ToString();
                        }
                        if (flasharray2[6].ToString() != "")
                        {
                            lblflash18.Text = flasharray2[6].ToString();
                        }
                        if (flasharray2[7].ToString() != "")
                        {
                            lblflash19.Text = flasharray2[7].ToString();
                        }
                        if (flasharray2[8].ToString() != "")
                        {
                            lblflash20.Text = flasharray2[8].ToString();
                        }
                        if (flasharray2[9].ToString() != "")
                        {
                            lblflash21.Text = flasharray2[9].ToString();
                        }
                        if (flasharray2[10].ToString() != "")
                        {
                            lblflash22.Text = flasharray2[10].ToString();
                        }
                    }
                }
                if (j == 2)
                {
                    flashtr3++;
                    string[]      flasharray3 = { };
                    StringBuilder sb_flash3   = new StringBuilder();
                    sb_flash3.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_flash3.ToString();
                    flasharray3 = perfvalue1.Split(',');
                    if (flasharray3.Count() > 0)
                    {
                        if (flasharray3[0].ToString() != "")
                        {
                            lblflash23.Text = flasharray3[0].ToString();
                        }
                        if (flasharray3[1].ToString() != "")
                        {
                            lblflash24.Text = flasharray3[1].ToString();
                        }
                        if (flasharray3[2].ToString() != "")
                        {
                            lblflash25.Text = flasharray3[2].ToString();
                        }
                        if (flasharray3[3].ToString() != "")
                        {
                            lblflash26.Text = flasharray3[3].ToString();
                        }
                        if (flasharray3[4].ToString() != "")
                        {
                            lblflash27.Text = flasharray3[4].ToString();
                        }
                        if (flasharray3[5].ToString() != "")
                        {
                            lblflash28.Text = flasharray3[5].ToString();
                        }
                        if (flasharray3[6].ToString() != "")
                        {
                            lblflash29.Text = flasharray3[6].ToString();
                        }
                        if (flasharray3[7].ToString() != "")
                        {
                            lblflash30.Text = flasharray3[7].ToString();
                        }
                        if (flasharray3[8].ToString() != "")
                        {
                            lblflash31.Text = flasharray3[8].ToString();
                        }
                        if (flasharray3[9].ToString() != "")
                        {
                            lblflash32.Text = flasharray3[9].ToString();
                        }
                        if (flasharray3[10].ToString() != "")
                        {
                            lblflash33.Text = flasharray3[10].ToString();
                        }
                    }
                }
            }
        }
    }
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            if (edit_Reportid == "" || edit_Reportid == null)
            {
                save_performancetest();
                for (int i = 0; i < 3; i++)
                {
                    if (i == 0)
                    {
                        Defibrillation.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtstd1.Text.Trim().Replace("'", "''") + "," + txtinst1.Text.Trim().Replace("'", "''") + "," +
                                               txtinst2.Text.Trim().Replace("'", "''") + "," + txtinst3.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                               txtdev1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 1)
                    {
                        Defibrillation.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtstd2.Text.Trim().Replace("'", "''") + "," + txtinst4.Text.Trim().Replace("'", "''") + "," +
                                               txtinst5.Text.Trim().Replace("'", "''") + "," + txtinst6.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                               txtdev2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                    if (i == 2)
                    {
                        Defibrillation.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtstd3.Text.Trim().Replace("'", "''") + "," + txtinst7.Text.Trim().Replace("'", "''") + "," +
                                               txtinst8.Text.Trim().Replace("'", "''") + "," + txtinst9.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                               txtdev3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }
                lblmsg.Text = "Data Inserted Successfully";
                lblmsg.Style.Add("color", "green");
            }
            else
            {
                save_performancetest();
                db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='" + edit_Reportid + "' and PerfID='49'";
                DataTable dt_valueid = db1.selecttable();
                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        if (i == 0)
                        {
                            string valid = dt_valueid.Rows[i]["ValueID"].ToString();
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            Defibrillation.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtstd1.Text.Trim().Replace("'", "''") + "," + txtinst1.Text.Trim().Replace("'", "''") + "," +
                                                   txtinst2.Text.Trim().Replace("'", "''") + "," + txtinst3.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                   txtdev1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");

                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            Defibrillation.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtstd2.Text.Trim().Replace("'", "''") + "," + txtinst4.Text.Trim().Replace("'", "''") + "," +
                                                   txtinst5.Text.Trim().Replace("'", "''") + "," + txtinst6.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                   txtdev2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");

                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            Defibrillation.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtstd3.Text.Trim().Replace("'", "''") + "," + txtinst7.Text.Trim().Replace("'", "''") + "," +
                                                   txtinst8.Text.Trim().Replace("'", "''") + "," + txtinst9.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                   txtdev3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");

                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 3; i++)
                    {
                        if (i == 0)
                        {
                            Defibrillation.Value = txtsl1.Text.Trim().Replace("'", "''") + "," + txtstd1.Text.Trim().Replace("'", "''") + "," + txtinst1.Text.Trim().Replace("'", "''") + "," +
                                                   txtinst2.Text.Trim().Replace("'", "''") + "," + txtinst3.Text.Trim().Replace("'", "''") + "," + txtmean1.Text.Trim().Replace("'", "''") + "," +
                                                   txtdev1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 1)
                        {
                            Defibrillation.Value = txtsl2.Text.Trim().Replace("'", "''") + "," + txtstd2.Text.Trim().Replace("'", "''") + "," + txtinst4.Text.Trim().Replace("'", "''") + "," +
                                                   txtinst5.Text.Trim().Replace("'", "''") + "," + txtinst6.Text.Trim().Replace("'", "''") + "," + txtmean2.Text.Trim().Replace("'", "''") + "," +
                                                   txtdev2.Text.Trim().Replace("'", "''") + "," + txtrem2.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                        if (i == 2)
                        {
                            Defibrillation.Value = txtsl3.Text.Trim().Replace("'", "''") + "," + txtstd3.Text.Trim().Replace("'", "''") + "," + txtinst7.Text.Trim().Replace("'", "''") + "," +
                                                   txtinst8.Text.Trim().Replace("'", "''") + "," + txtinst9.Text.Trim().Replace("'", "''") + "," + txtmean3.Text.Trim().Replace("'", "''") + "," +
                                                   txtdev3.Text.Trim().Replace("'", "''") + "," + txtrem3.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["perfid49"].ToString() + "','" + Defibrillation.Value + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }

                lblmsg.Text = "Data Updated Successfully";
                lblmsg.Style.Add("color", "green");
            }
        }
        catch (Exception ex)
        {
            lblmsg.Text = "Data not Inserted Successfully" + ex;
            lblmsg.Style.Add("color", "red");
        }
    }
Esempio n. 23
0
    public void Bind_Bipolarmode(string sReportid, string sPerfid)
    {
        bipolarid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    bipolartr1++;
                    string[]      bipolararray = { };
                    StringBuilder sb_bipol1    = new StringBuilder();
                    sb_bipol1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_bipol1.ToString();
                    bipolararray = perfvalue1.Split(',');
                    if (bipolararray.Count() > 0)
                    {
                        if (bipolararray[0].ToString() != "")
                        {
                            lblbipol1.Text = bipolararray[0].ToString();
                        }
                        if (bipolararray[1].ToString() != "")
                        {
                            lblbipol2.Text = bipolararray[1].ToString();
                        }
                        if (bipolararray[2].ToString() != "")
                        {
                            lblbipol3.Text = bipolararray[2].ToString();
                        }
                        if (bipolararray[3].ToString() != "")
                        {
                            lblbipol4.Text = bipolararray[3].ToString();
                        }
                        if (bipolararray[4].ToString() != "")
                        {
                            lblbipol5.Text = bipolararray[4].ToString();
                        }
                        if (bipolararray[5].ToString() != "")
                        {
                            lblbipol6.Text = bipolararray[5].ToString();
                        }
                        if (bipolararray[6].ToString() != "")
                        {
                            lblbipol7.Text = bipolararray[6].ToString();
                        }
                    }
                }
                if (j == 1)
                {
                    bipolartr2++;
                    string[]      bipolar2array = { };
                    StringBuilder sb_bipol2     = new StringBuilder();
                    sb_bipol2.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue2 = sb_bipol2.ToString();
                    bipolar2array = perfvalue2.Split(',');
                    if (bipolar2array.Count() > 0)
                    {
                        if (bipolar2array[0].ToString() != "")
                        {
                            lblbipol8.Text = bipolar2array[0].ToString();
                        }
                        if (bipolar2array[1].ToString() != "")
                        {
                            lblbipol9.Text = bipolar2array[1].ToString();
                        }
                        if (bipolar2array[2].ToString() != "")
                        {
                            lblbipol10.Text = bipolar2array[2].ToString();
                        }
                        if (bipolar2array[3].ToString() != "")
                        {
                            lblbipol11.Text = bipolar2array[3].ToString();
                        }
                        if (bipolar2array[4].ToString() != "")
                        {
                            lblbipol12.Text = bipolar2array[4].ToString();
                        }
                        if (bipolar2array[5].ToString() != "")
                        {
                            lblbipol13.Text = bipolar2array[5].ToString();
                        }
                        if (bipolar2array[6].ToString() != "")
                        {
                            lblbipol14.Text = bipolar2array[6].ToString();
                        }
                    }
                }
                if (j == 2)
                {
                    bipolartr3++;
                    string[]      bipolar3array = { };
                    StringBuilder sb_bipol3     = new StringBuilder();
                    sb_bipol3.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue3 = sb_bipol3.ToString();
                    bipolar3array = perfvalue3.Split(',');
                    if (bipolar3array.Count() > 0)
                    {
                        if (bipolar3array[0].ToString() != "")
                        {
                            lblbipol15.Text = bipolar3array[0].ToString();
                        }
                        if (bipolar3array[1].ToString() != "")
                        {
                            lblbipol16.Text = bipolar3array[1].ToString();
                        }
                        if (bipolar3array[2].ToString() != "")
                        {
                            lblbipol17.Text = bipolar3array[2].ToString();
                        }
                        if (bipolar3array[3].ToString() != "")
                        {
                            lblbipol18.Text = bipolar3array[3].ToString();
                        }
                        if (bipolar3array[4].ToString() != "")
                        {
                            lblbipol19.Text = bipolar3array[4].ToString();
                        }
                        if (bipolar3array[5].ToString() != "")
                        {
                            lblbipol20.Text = bipolar3array[5].ToString();
                        }
                        if (bipolar3array[6].ToString() != "")
                        {
                            lblbipol21.Text = bipolar3array[6].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 24
0
    public void BindValue()
    {
        db1.strCommand = "select * from Performance_Values where PerfID='5'";
        DataTable     dt = db1.selecttable();
        int           count = dt.Rows.Count;
        StringBuilder sb = new StringBuilder();
        StringBuilder sbid = new StringBuilder();
        string        val = "", valid = "";;

        string[] value      = { }, valueid = { };
        string[] splitarray = { };
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < count; i++)
            {
                sb.Append(dt.Rows[i]["Perf_Value"].ToString() + " ");
                sbid.Append(dt.Rows[i]["ValueID"].ToString() + " ");
            }


            val     = sb.ToString();
            valid   = sbid.ToString();
            value   = val.Split();
            valueid = valid.Split();
            int validcount = valueid.Count();
            int valcount   = value.Count();
            for (int i = 0; i < valcount - 1; i++)
            {
                if (i == 0)
                {
                    string   value_1      = value[i].ToString();
                    string   valueid_1    = valueid[i].ToString();
                    string[] value_1array = value_1.Split(',');
                    int      valid_1count = value_1array.Count();
                    for (int j = 0; j < valid_1count - 1; j++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(splitvalues,ValueID)values('" + value_1array[j].ToString() + "','" + valueid_1 + "')";
                        db1.insertqry();
                    }
                }
                if (i == 1)
                {
                    string   value_2      = value[i].ToString();
                    string   valueid_2    = valueid[i].ToString();
                    string[] value_2array = value_2.Split(',');
                    int      valid_2count = value_2array.Count();
                    for (int j = 0; j < valid_2count - 1; j++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(splitvalues,ValueID)values('" + value_2array[j].ToString() + "','" + valueid_2 + "')";
                        db1.insertqry();
                    }
                }
                if (i == 2)
                {
                    string   value_3      = value[i].ToString();
                    string   valueid_3    = valueid[i].ToString();
                    string[] value_3array = value_3.Split(',');
                    int      valid_3count = value_3array.Count();
                    for (int j = 0; j < valid_3count - 1; j++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(splitvalues,ValueID)values('" + value_3array[j].ToString() + "','" + valueid_3 + "')";
                        db1.insertqry();
                    }
                }
                if (i == 3)
                {
                    string   value_4      = value[i].ToString();
                    string   valueid_4    = valueid[i].ToString();
                    string[] value_4array = value_4.Split(',');
                    int      valid_4count = value_4array.Count();
                    for (int j = 0; j < valid_4count - 1; j++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(splitvalues,ValueID)values('" + value_4array[j].ToString() + "','" + valueid_4 + "')";
                        db1.insertqry();
                    }
                }
                if (i == 4)
                {
                    string   value_5      = value[i].ToString();
                    string   valueid_5    = valueid[i].ToString();
                    string[] value_5array = value_5.Split(',');
                    int      valid_5count = value_5array.Count();
                    for (int j = 0; j < valid_5count - 1; j++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(splitvalues,ValueID)values('" + value_5array[j].ToString() + "','" + valueid_5 + "')";
                        db1.insertqry();
                    }
                }
            }
        }
    }
Esempio n. 25
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            if (edit_Reportid == "" || edit_Reportid == null)
            {
                save_performancetest();
                for (int i = 0; i < 3; i++)
                {
                    if (i == 0)
                    {
                        flow_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," +
                                            txtcon1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                        db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid47"].ToString() + "','" + flow_hidden.Value + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }

                db1.strCommand = "select Top 1 ValueID from Performance_Values order by ValueID desc";
                DataTable dt_valueid = db1.selecttable();

                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < 1; i++)
                    {
                        db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid47"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                        db1.insertqry();
                    }
                }
                lblmsg.Text = "Data Inserted Successfully";
                lblmsg.Style.Add("color", "green");
            }
            else
            {
                save_performancetest();
                db1.strCommand = "select ValueID from Performance_Values where Report_info_ID='" + edit_Reportid + "' and PerfID='47'";
                DataTable dt_valueid = db1.selecttable();
                if (dt_valueid.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_valueid.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            db1.strCommand = "delete from Performance_Values where ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "' and Report_info_ID='" + edit_Reportid + "'";
                            db1.insertqry();
                            flow_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," +
                                                txtcon1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                            //db1.strCommand = "Update Performance_Values set PerfID='" + Session["Perfid47"].ToString() + "',Perf_Value='" + flow_hidden.Value + "'" +
                            //   " where Report_info_ID='" + edit_Reportid + "' and ValueID='" + dt_valueid.Rows[i]["ValueID"].ToString() + "'";
                            //db1.insertqry();
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,Report_info_ID,ReportNo) values('" + Session["Perfid47"].ToString() + "','" + flow_hidden.Value + "','" + edit_Reportid + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                    if (dt_valueid.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt_valueid.Rows.Count; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid47"].ToString() + "','" + dt_valueid.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 1; i++)
                    {
                        if (i == 0)
                        {
                            flow_hidden.Value = txtsl1.Text.Trim().Replace("'", "''") + "," +
                                                txtcon1.Text.Trim().Replace("'", "''") + "," + txtrem1.Text.Trim().Replace("'", "''");
                            db1.strCommand = "insert into Performance_Values(PerfID,Perf_Value,ReportNo) values('" + Session["Perfid47"].ToString() + "','" + flow_hidden.Value + "',ReportNo)";
                            db1.insertqry();
                        }
                    }

                    db1.strCommand = "select Top 1 ValueID from Performance_Values order by ValueID desc";
                    DataTable dt_valueidupdate = db1.selecttable();

                    if (dt_valueidupdate.Rows.Count > 0)
                    {
                        for (int i = 0; i < 1; i++)
                        {
                            db1.strCommand = "insert into perfvaluesplit(PerfID,ValueID,ReportNo)values('" + Session["Perfid47"].ToString() + "','" + dt_valueidupdate.Rows[i]["ValueID"].ToString() + "','" + Session["ReportNo"].ToString() + "')";
                            db1.insertqry();
                        }
                    }
                }

                lblmsg.Text = "Data Updated Successfully";
                lblmsg.Style.Add("color", "green");
            }
        }
        catch
        {
            lblmsg.Text = "Data not Inserted Successfully";
            lblmsg.Style.Add("color", "red");
        }
    }
    public void Bind_vaccum(string sReportid, string sPerfid)
    {
        vaccumid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];
            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    vaccumtr1++;
                    string[]      vaccumarray1 = { };
                    StringBuilder sb_vaccum1   = new StringBuilder();
                    sb_vaccum1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_vaccum1.ToString();
                    vaccumarray1 = perfvalue1.Split(',');
                    if (vaccumarray1.Count() > 0)
                    {
                        if (vaccumarray1[0].ToString() != "")
                        {
                            lblvaccum1.Text = vaccumarray1[0].ToString();
                        }
                        if (vaccumarray1[1].ToString() != "")
                        {
                            lblvaccum2.Text = vaccumarray1[1].ToString();
                        }
                        if (vaccumarray1[2].ToString() != "")
                        {
                            lblvaccum3.Text = vaccumarray1[2].ToString();
                        }
                        if (vaccumarray1[3].ToString() != "")
                        {
                            lblvaccum4.Text = vaccumarray1[3].ToString();
                        }
                        if (vaccumarray1[4].ToString() != "")
                        {
                            lblvaccum5.Text = vaccumarray1[4].ToString();
                        }
                        if (vaccumarray1[5].ToString() != "")
                        {
                            lblvaccum6.Text = vaccumarray1[5].ToString();
                        }
                    }
                }
                if (j == 1)
                {
                    vaccumtr2++;
                    string[]      vaccumarray2 = { };
                    StringBuilder sb_vaccum2   = new StringBuilder();
                    sb_vaccum2.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue2 = sb_vaccum2.ToString();
                    vaccumarray2 = perfvalue2.Split(',');
                    if (vaccumarray2.Count() > 0)
                    {
                        if (vaccumarray2[0].ToString() != "")
                        {
                            lblvaccum7.Text = vaccumarray2[0].ToString();
                        }
                        if (vaccumarray2[1].ToString() != "")
                        {
                            lblvaccum8.Text = vaccumarray2[1].ToString();
                        }
                        if (vaccumarray2[2].ToString() != "")
                        {
                            lblvaccum9.Text = vaccumarray2[2].ToString();
                        }
                        if (vaccumarray2[3].ToString() != "")
                        {
                            lblvaccum10.Text = vaccumarray2[3].ToString();
                        }
                        if (vaccumarray2[4].ToString() != "")
                        {
                            lblvaccum11.Text = vaccumarray2[4].ToString();
                        }
                        if (vaccumarray2[5].ToString() != "")
                        {
                            lblvaccum12.Text = vaccumarray2[5].ToString();
                        }
                    }
                }
                if (j == 2)
                {
                    vaccumtr3++;
                    string[]      vaccumarray3 = { };
                    StringBuilder sb_vaccum3   = new StringBuilder();
                    sb_vaccum3.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue3 = sb_vaccum3.ToString();
                    vaccumarray3 = perfvalue3.Split(',');
                    if (vaccumarray3.Count() > 0)
                    {
                        if (vaccumarray3[0].ToString() != "")
                        {
                            lblvaccum13.Text = vaccumarray3[0].ToString();
                        }
                        if (vaccumarray3[1].ToString() != "")
                        {
                            lblvaccum14.Text = vaccumarray3[1].ToString();
                        }
                        if (vaccumarray3[2].ToString() != "")
                        {
                            lblvaccum15.Text = vaccumarray3[2].ToString();
                        }
                        if (vaccumarray3[3].ToString() != "")
                        {
                            lblvaccum16.Text = vaccumarray3[3].ToString();
                        }
                        if (vaccumarray3[4].ToString() != "")
                        {
                            lblvaccum17.Text = vaccumarray3[4].ToString();
                        }
                        if (vaccumarray3[5].ToString() != "")
                        {
                            lblvaccum18.Text = vaccumarray3[5].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 27
0
    public void Bind_Pulseamplitude(string sReportid, string sPerfid)
    {
        pulseampliid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    pulseamplitr1++;
                    string[]      pulseampliarray1 = { };
                    StringBuilder sb_pulseampli1   = new StringBuilder();
                    sb_pulseampli1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_pulseampli1.ToString();
                    pulseampliarray1 = perfvalue1.Split(',');
                    if (pulseampliarray1.Count() > 0)
                    {
                        if (pulseampliarray1[0].ToString() != "")
                        {
                            lblpulseampli1.Text = pulseampliarray1[0].ToString();
                        }
                        if (pulseampliarray1[1].ToString() != "")
                        {
                            lblpulseampli2.Text = pulseampliarray1[1].ToString();
                        }
                        if (pulseampliarray1[2].ToString() != "")
                        {
                            lblpulseampli3.Text = pulseampliarray1[2].ToString();
                        }
                        if (pulseampliarray1[3].ToString() != "")
                        {
                            lblpulseampli4.Text = pulseampliarray1[3].ToString();
                        }
                        if (pulseampliarray1[4].ToString() != "")
                        {
                            lblpulseampli5.Text = pulseampliarray1[4].ToString();
                        }
                        if (pulseampliarray1[5].ToString() != "")
                        {
                            lblpulseampli6.Text = pulseampliarray1[5].ToString();
                        }
                        if (pulseampliarray1[6].ToString() != "")
                        {
                            lblpulseampli7.Text = pulseampliarray1[6].ToString();
                        }
                    }
                }
                if (j == 1)
                {
                    pulseamplitr2++;
                    string[]      pulseampliarray2 = { };
                    StringBuilder sb_pulseampli2   = new StringBuilder();
                    sb_pulseampli2.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue2 = sb_pulseampli2.ToString();
                    pulseampliarray2 = perfvalue2.Split(',');
                    if (pulseampliarray2.Count() > 0)
                    {
                        if (pulseampliarray2[0].ToString() != "")
                        {
                            lblpulseampli8.Text = pulseampliarray2[0].ToString();
                        }
                        if (pulseampliarray2[1].ToString() != "")
                        {
                            lblpulseampli9.Text = pulseampliarray2[1].ToString();
                        }
                        if (pulseampliarray2[2].ToString() != "")
                        {
                            lblpulseampli10.Text = pulseampliarray2[2].ToString();
                        }
                        if (pulseampliarray2[3].ToString() != "")
                        {
                            lblpulseampli11.Text = pulseampliarray2[3].ToString();
                        }
                        if (pulseampliarray2[4].ToString() != "")
                        {
                            lblpulseampli12.Text = pulseampliarray2[4].ToString();
                        }
                        if (pulseampliarray2[5].ToString() != "")
                        {
                            lblpulseampli13.Text = pulseampliarray2[5].ToString();
                        }
                        if (pulseampliarray2[6].ToString() != "")
                        {
                            lblpulseampli14.Text = pulseampliarray2[6].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 28
0
    public void Bind_Tempmeasure(string sReportid, string sPerfid)
    {
        deepfreeid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    deepfreezertr1++;
                    string[]      deepfreezerarray1 = { };
                    StringBuilder sb_accu1          = new StringBuilder();
                    sb_accu1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_accu1.ToString();
                    deepfreezerarray1 = perfvalue1.Split(',');
                    if (deepfreezerarray1.Count() > 0)
                    {
                        if (deepfreezerarray1[0].ToString() != "")
                        {
                            lbldeep1.Text = deepfreezerarray1[0].ToString();
                        }
                        if (deepfreezerarray1[1].ToString() != "")
                        {
                            lblsetdut1.Text = deepfreezerarray1[1].ToString();
                        }
                        if (deepfreezerarray1[2].ToString() != "")
                        {
                            lbldeep2.Text = deepfreezerarray1[2].ToString();
                        }
                        if (deepfreezerarray1[3].ToString() != "")
                        {
                            lbldeep3.Text = deepfreezerarray1[3].ToString();
                        }
                        if (deepfreezerarray1[4].ToString() != "")
                        {
                            lbldeep4.Text = deepfreezerarray1[4].ToString();
                        }
                        if (deepfreezerarray1[5].ToString() != "")
                        {
                            lbldeep5.Text = deepfreezerarray1[5].ToString();
                        }
                        if (deepfreezerarray1[6].ToString() != "")
                        {
                            lbldeep6.Text = deepfreezerarray1[6].ToString();
                        }

                        if (deepfreezerarray1[7].ToString() != "")
                        {
                            lbldeep7.Text = deepfreezerarray1[7].ToString();
                        }
                        if (deepfreezerarray1[8].ToString() != "")
                        {
                            lbldeep8.Text = deepfreezerarray1[8].ToString();
                        }
                    }
                }
                if (j == 1)
                {
                    deepfreezertr2++;
                    string[]      deepfreezerarray2 = { };
                    StringBuilder sb_accu2          = new StringBuilder();
                    sb_accu2.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_accu2.ToString();
                    deepfreezerarray2 = perfvalue1.Split(',');
                    if (deepfreezerarray2.Count() > 0)
                    {
                        if (deepfreezerarray2[0].ToString() != "")
                        {
                            lbldeep9.Text = deepfreezerarray2[0].ToString();
                        }
                        if (deepfreezerarray2[1].ToString() != "")
                        {
                            lblsetdut2.Text = deepfreezerarray2[1].ToString();
                        }
                        if (deepfreezerarray2[2].ToString() != "")
                        {
                            lbldeep10.Text = deepfreezerarray2[2].ToString();
                        }
                        if (deepfreezerarray2[3].ToString() != "")
                        {
                            lbldeep11.Text = deepfreezerarray2[3].ToString();
                        }
                        if (deepfreezerarray2[4].ToString() != "")
                        {
                            lbldeep12.Text = deepfreezerarray2[4].ToString();
                        }
                        if (deepfreezerarray2[5].ToString() != "")
                        {
                            lbldeep13.Text = deepfreezerarray2[5].ToString();
                        }
                        if (deepfreezerarray2[6].ToString() != "")
                        {
                            lbldeep14.Text = deepfreezerarray2[6].ToString();
                        }

                        if (deepfreezerarray2[7].ToString() != "")
                        {
                            lbldeep15.Text = deepfreezerarray2[7].ToString();
                        }
                        if (deepfreezerarray2[8].ToString() != "")
                        {
                            lbldeep16.Text = deepfreezerarray2[8].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 29
0
    public void Bind_MicroPipetteData(string sReportid, string sPerfid)
    {
        microPiptId++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    microPiptTr1++;
                    string[]      microPiptArray1 = { };
                    StringBuilder sb_MicroPipt1   = new StringBuilder();
                    sb_MicroPipt1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_MicroPipt1.ToString();
                    microPiptArray1 = perfvalue1.Split(',');
                    if (microPiptArray1.Count() > 0)
                    {
                        if (microPiptArray1[0].ToString() != "")
                        {
                            lbl_micropipt1_1.Text = microPiptArray1[0].ToString();
                        }
                        if (microPiptArray1[1].ToString() != "")
                        {
                            lbl_micropipt1_2.Text = microPiptArray1[1].ToString();
                        }
                        if (microPiptArray1[2].ToString() != "")
                        {
                            lbl_micropipt1_3.Text = microPiptArray1[2].ToString();
                        }
                        if (microPiptArray1[3].ToString() != "")
                        {
                            lbl_micropipt1_4.Text = microPiptArray1[3].ToString();
                        }
                        if (microPiptArray1[4].ToString() != "")
                        {
                            lbl_micropipt1_5.Text = microPiptArray1[4].ToString();
                        }
                        if (microPiptArray1[5].ToString() != "")
                        {
                            lbl_micropipt1_6.Text = microPiptArray1[5].ToString();
                        }
                    }
                }
                if (j == 1)
                {
                    microPiptTr2++;
                    string[]      microPiptArray2 = { };
                    StringBuilder sb_MicroPipt2   = new StringBuilder();
                    sb_MicroPipt2.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_MicroPipt2.ToString();
                    microPiptArray2 = perfvalue1.Split(',');
                    if (microPiptArray2.Count() > 0)
                    {
                        if (microPiptArray2[0].ToString() != "")
                        {
                            lbl_micropipt2_1.Text = microPiptArray2[0].ToString();
                        }
                        if (microPiptArray2[1].ToString() != "")
                        {
                            lbl_micropipt2_2.Text = microPiptArray2[1].ToString();
                        }
                        if (microPiptArray2[2].ToString() != "")
                        {
                            lbl_micropipt2_3.Text = microPiptArray2[2].ToString();
                        }
                        if (microPiptArray2[3].ToString() != "")
                        {
                            lbl_micropipt2_4.Text = microPiptArray2[3].ToString();
                        }
                        if (microPiptArray2[4].ToString() != "")
                        {
                            lbl_micropipt2_5.Text = microPiptArray2[4].ToString();
                        }
                        if (microPiptArray2[5].ToString() != "")
                        {
                            lbl_micropipt2_6.Text = microPiptArray2[5].ToString();
                        }
                    }
                }
                if (j == 2)
                {
                    microPiptTr3++;
                    string[]      microPiptArray3 = { };
                    StringBuilder sb_MicroPipt3   = new StringBuilder();
                    sb_MicroPipt3.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_MicroPipt3.ToString();
                    microPiptArray3 = perfvalue1.Split(',');
                    if (microPiptArray3.Count() > 0)
                    {
                        if (microPiptArray3[0].ToString() != "")
                        {
                            lbl_micropipt3_1.Text = microPiptArray3[0].ToString();
                        }
                        if (microPiptArray3[1].ToString() != "")
                        {
                            lbl_micropipt3_2.Text = microPiptArray3[1].ToString();
                        }
                        if (microPiptArray3[2].ToString() != "")
                        {
                            lbl_micropipt3_3.Text = microPiptArray3[2].ToString();
                        }
                        if (microPiptArray3[3].ToString() != "")
                        {
                            lbl_micropipt3_4.Text = microPiptArray3[3].ToString();
                        }
                        if (microPiptArray3[4].ToString() != "")
                        {
                            lbl_micropipt3_5.Text = microPiptArray3[4].ToString();
                        }
                        if (microPiptArray3[5].ToString() != "")
                        {
                            lbl_micropipt3_6.Text = microPiptArray3[5].ToString();
                        }
                    }
                }
                if (j == 3)
                {
                    microPiptTr4++;
                    string[]      microPiptArray4 = { };
                    StringBuilder sb_MicroPipt4   = new StringBuilder();
                    sb_MicroPipt4.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_MicroPipt4.ToString();
                    microPiptArray4 = perfvalue1.Split(',');
                    if (microPiptArray4.Count() > 0)
                    {
                        if (microPiptArray4[0].ToString() != "")
                        {
                            lbl_micropipt4_1.Text = microPiptArray4[0].ToString();
                        }
                        if (microPiptArray4[1].ToString() != "")
                        {
                            lbl_micropipt4_2.Text = microPiptArray4[1].ToString();
                        }
                        if (microPiptArray4[2].ToString() != "")
                        {
                            lbl_micropipt4_3.Text = microPiptArray4[2].ToString();
                        }
                        if (microPiptArray4[3].ToString() != "")
                        {
                            lbl_micropipt4_4.Text = microPiptArray4[3].ToString();
                        }
                        if (microPiptArray4[4].ToString() != "")
                        {
                            lbl_micropipt4_5.Text = microPiptArray4[4].ToString();
                        }
                        if (microPiptArray4[5].ToString() != "")
                        {
                            lbl_micropipt4_6.Text = microPiptArray4[5].ToString();
                        }
                    }
                }
            }
        }
    }
Esempio n. 30
0
    public void Bind_Temphotair(string sReportid, string sPerfid)
    {
        temphotairid++;
        db1.strCommand = "select Perf_Value from Performance_Values where " +
                         "Report_info_ID='" + sReportid + "' and PerfID='" + sPerfid + "'";
        DataTable dt_value = db1.selecttable();

        if (dt_value.Rows.Count > 0)
        {
            //object[] valarray=new object[dt_value.Rows.Count];

            for (int j = 0; j < dt_value.Rows.Count; j++)
            {
                if (j == 0)
                {
                    temphotairtr1++;
                    string[]      temphotairarray1 = { };
                    StringBuilder sb_temphotair1   = new StringBuilder();
                    sb_temphotair1.Append(dt_value.Rows[j]["Perf_Value"].ToString());
                    string perfvalue1 = sb_temphotair1.ToString();
                    temphotairarray1 = perfvalue1.Split(',');
                    if (temphotairarray1.Count() > 0)
                    {
                        if (temphotairarray1[0].ToString() != "")
                        {
                            lblhot1.Text = temphotairarray1[0].ToString();
                        }
                        if (temphotairarray1[1].ToString() != "")
                        {
                            lblhot2.Text = temphotairarray1[1].ToString();
                        }
                        if (temphotairarray1[2].ToString() != "")
                        {
                            lblhot3.Text = temphotairarray1[2].ToString();
                        }
                        if (temphotairarray1[3].ToString() != "")
                        {
                            lblhot4.Text = temphotairarray1[3].ToString();
                        }
                        if (temphotairarray1[4].ToString() != "")
                        {
                            lblhot5.Text = temphotairarray1[4].ToString();
                        }
                        if (temphotairarray1[5].ToString() != "")
                        {
                            lblhot6.Text = temphotairarray1[5].ToString();
                        }
                        if (temphotairarray1[6].ToString() != "")
                        {
                            lblhot7.Text = temphotairarray1[6].ToString();
                        }
                        if (temphotairarray1[7].ToString() != "")
                        {
                            lblhot8.Text = temphotairarray1[7].ToString();
                        }
                        if (temphotairarray1[8].ToString() != "")
                        {
                            lblhot9.Text = temphotairarray1[8].ToString();
                        }
                        if (temphotairarray1[9].ToString() != "")
                        {
                            lblhot10.Text = temphotairarray1[9].ToString();
                        }
                        if (temphotairarray1[10].ToString() != "")
                        {
                            lblhot11.Text = temphotairarray1[10].ToString();
                        }
                        if (temphotairarray1[11].ToString() != "")
                        {
                            lblhot12.Text = temphotairarray1[11].ToString();
                        }
                    }
                }
            }
        }
    }