Пример #1
0
    protected void Gridview_PMSupply_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        if (-2 == e.NewPageIndex)
        {
            TextBox     txtNewPageIndex = null;
            GridViewRow pagerRow        = Gridview2.BottomPagerRow;


            if (null != pagerRow)
            {
                txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox");   // refer to the TextBox with the NewPageIndex value
            }

            if (null != txtNewPageIndex && txtNewPageIndex.Text != "")
            {
                newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex
            }
        }
        else
        {
            newPageIndex = e.NewPageIndex;
        }
        BindGridview2("");
        Gridview2.DataBind();
        newPageIndex        = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex        = newPageIndex >= Gridview2.PageCount ? Gridview2.PageCount - 1 : newPageIndex;
        Gridview2.PageIndex = newPageIndex;
        Gridview2.DataBind();
    }
Пример #2
0
    protected void BindData()
    {
        qry1 = "select Id,fin_year,case when Status='1' then 'OPEN' when Status='0' then 'CLOSE' when Status='2' then 'TRIAL' else '' end sts,FORMAT(fin_start_dt,'dd/MM/yyyy') st_dt,FORMAT(fin_end_dt,'dd/MM/yyyy') ed_dt,fin_months,fin_period from KW_financial_Year where fin_kod_syarikat='" + txt_nombo.Text + "'";
        SqlCommand     cmd2 = new SqlCommand("" + qry1 + "", con);
        SqlDataAdapter da2  = new SqlDataAdapter(cmd2);
        DataSet        ds2  = new DataSet();

        da2.Fill(ds2);
        if (ds2.Tables[0].Rows.Count == 0)
        {
            ds2.Tables[0].Rows.Add(ds2.Tables[0].NewRow());
            Gridview2.DataSource = ds2;
            Gridview2.DataBind();
            int columncount = Gridview2.Rows[0].Cells.Count;
            Gridview2.Rows[0].Cells.Clear();
            Gridview2.Rows[0].Cells.Add(new TableCell());
            Gridview2.Rows[0].Cells[0].ColumnSpan = columncount;
            Gridview2.Rows[0].Cells[0].Text       = "<center><strong>Maklumat Carian Tidak Dijumpai</strong></center>";
        }
        else
        {
            Gridview2.DataSource = ds2;
            Gridview2.DataBind();
        }
    }
    protected void Gridview2_RowEditing(object sender, GridViewEditEventArgs e)
    {
        Gridview2.EditIndex = e.NewEditIndex;
        Label     RECOMD_ID   = (Label)Gridview2.Rows[e.NewEditIndex].FindControl("RECOMD_ID");
        Label     RECOM_ID    = (Label)Gridview2.Rows[e.NewEditIndex].FindControl("RECOM_ID");
        Hashtable vHashtable1 = new Hashtable();

        vHashtable1.Add("RECOMD_ID", RECOMD_ID.Text);
        vHashtable1.Add("TYPE", "GET");
        DataRow vDR = RetDR(DBManager.Get(vHashtable1, "GET_RECOMMENDATION_DETAIL_NEW"));

        if (vDR != null)
        {
            RECO_TXT.Text       = vDR["RECOM_TEXT"].ToString();
            Textarea1.InnerText = vDR["RECOMD_DESC"].ToString();
        }
        Hashtable vHashtable3 = new Hashtable();

        vHashtable3.Add("RECOM_ID", RECOM_ID.Text);
        DataTable dt3 = DBManager.Get(vHashtable3, "GET_RECOMMENDATION_ID");

        Gridview2.DataSource = dt3;
        Gridview2.DataBind();
        Gridview2.HeaderRow.Cells[04].Visible = false;
        foreach (GridViewRow gdr in Gridview2.Rows)
        {
            gdr.Cells[04].Visible = false;
        }
        btnAdd.Visible  = false;
        btnSave.Visible = false;
    }
        //enable Gridview to enter Claims details
        public void ClaimButton_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            DataRow   dr = null;

            dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));
            dt.Columns.Add(new DataColumn("ClaimDescription", typeof(string)));
            dt.Columns.Add(new DataColumn("ClaimDate", typeof(string)));

            dr = dt.NewRow();
            dr["RowNumber"]        = 1;
            dr["ClaimDescription"] = string.Empty;
            dr["ClaimDate"]        = string.Empty;
            dt.Rows.Add(dr);

            //Store the DataTable in ViewState
            Session["ClaimDetails"] = dt;

            if (Session["TotalClaimDetails"] == null)
            {
                Session["TotalClaimDetails"] = dt;
            }

            Gridview2.DataSource = dt;
            Gridview2.DataBind();
            this.Gridview2.Visible = true;


            //Method to display Driver with Claim Details as Table data
            SetDriverClaimsTableFilledRow();
        }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // If the user is not logged in, redirect them to the login page
        if (Session["New"] != null)
        {
            // If the user is not the administrator, redirect them to the home page
            if ((Session["New"].ToString().StartsWith("2")) || (Session["New"].ToString().StartsWith("3")))
            {
                Response.Redirect("/Default.aspx");
            }
        }
        else
        {
            Response.Redirect("/Login.aspx");
        }


        connection = System.Configuration.ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ToString();
        txtSearch.Attributes.Add("onkeyup", "setTimeout('__doPostBack(\'" + txtSearch.ClientID.Replace("_", "$") + "\',\'\')', 0);");

        if (!IsPostBack)
        {
            Gridview2.DataBind();
        }
    }
    protected void Gridview2_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Label RECOM_ID    = (Label)Gridview2.Rows[e.RowIndex].FindControl("RECOM_ID");
        Label RECOMD_ID   = (Label)Gridview2.Rows[e.RowIndex].FindControl("RECOMD_ID");
        Label RECOMD_DESC = (Label)Gridview2.Rows[e.RowIndex].FindControl("RECOMD_DESC");

        Hashtable vHashtable = new Hashtable();

        vHashtable.Add("RECOMD_ID", RECOMD_ID.Text);
        vHashtable.Add("RECOMD_DESC", Textarea1.InnerText);
        DBManager.ExecInsUps(vHashtable, "UPDATE_RECOM_ID", vATSession);
        Gridview2.EditIndex = -1;
        ShowMsg("Updated Successfully..........");
        Hashtable vHashtable3 = new Hashtable();

        vHashtable3.Add("RECOM_ID", RECOM_ID.Text);
        DataTable dt3 = DBManager.Get(vHashtable3, "GET_RECOMMENDATION_ID");

        Gridview2.DataSource = dt3;
        Gridview2.DataBind();
        Gridview2.HeaderRow.Cells[04].Visible = false;
        foreach (GridViewRow gdr in Gridview2.Rows)
        {
            gdr.Cells[04].Visible = false;
        }
        btnAdd.Visible  = true;
        btnSave.Visible = true;
    }
Пример #7
0
    //项目进度明细
    protected void Gridview_PS_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        if (-2 == e.NewPageIndex)
        {
            TextBox     txtNewPageIndex = null;
            GridViewRow pagerRow        = Gridview2.BottomPagerRow;


            if (null != pagerRow)
            {
                txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox");   // refer to the TextBox with the NewPageIndex value
            }

            if (null != txtNewPageIndex && txtNewPageIndex.Text != "")
            {
                newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex
            }
        }
        else
        {
            newPageIndex = e.NewPageIndex;
        }
        PRMProjectinfo.PRMP_ID = new Guid(label_projectid.Text.ToString());
        BindGridview2(PRMProjectinfo);
        Gridview2.DataSource = ppm.SelectPRMProject_Schedule(PRMProjectinfo);
        Gridview2.DataBind();
        newPageIndex        = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex        = newPageIndex >= Gridview2.PageCount ? Gridview2.PageCount - 1 : newPageIndex;
        Gridview2.PageIndex = newPageIndex;
        Gridview2.DataBind();
    }
Пример #8
0
    private void SetInitialRow()
    {
        DataTable dt = new DataTable();
        DataRow   dr = null;

        dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));
        dt.Columns.Add(new DataColumn("Column1", typeof(string)));
        dt.Columns.Add(new DataColumn("Column2", typeof(string)));
        dt.Columns.Add(new DataColumn("Column3", typeof(string)));
        dt.Columns.Add(new DataColumn("Column4", typeof(string)));
        dt.Columns.Add(new DataColumn("Column5", typeof(string)));
        dt.Columns.Add(new DataColumn("Column6", typeof(string)));
        dt.Columns.Add(new DataColumn("Column7", typeof(string)));
        dt.Columns.Add(new DataColumn("Column8", typeof(string)));
        dr = dt.NewRow();
        dr["RowNumber"] = 1;
        dr["Column1"]   = string.Empty;
        dr["Column2"]   = string.Empty;
        dr["Column3"]   = string.Empty;
        dr["Column4"]   = string.Empty;
        dr["Column5"]   = string.Empty;
        dr["Column6"]   = string.Empty;
        dr["Column7"]   = string.Empty;
        dr["Column8"]   = string.Empty;
        dt.Rows.Add(dr);

        //Store the DataTable in ViewState
        ViewState["CurrentTable"] = dt;

        Gridview2.DataSource = dt;
        Gridview2.DataBind();
    }
Пример #9
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        LinkButton  lb    = (LinkButton)sender;
        GridViewRow gvRow = (GridViewRow)lb.NamingContainer;
        Label       box1  = (Label)gvRow.FindControl("Label1");
        string      box   = box1.Text;
        int         rowID = gvRow.RowIndex + 1;

        if (ViewState["CurrentTable"] != null)
        {
            DataTable dt = (DataTable)ViewState["CurrentTable"];
            if (dt.Rows.Count > 1)
            {
                if (gvRow.RowIndex < dt.Rows.Count - 1)
                {
                    dt.Rows.Remove(dt.Rows[rowID]);
                    if (box != "")
                    {
                        File.Delete(Server.MapPath(@"" + box + ""));
                    }
                }
                if (dt.Rows.Count <= 1)
                {
                    Gridview2.Columns[8].Visible = false;
                }
            }
            ViewState["CurrentTable"] = dt;
            Gridview2.DataSource      = dt;
            Gridview2.DataBind();
            MultiView1.ActiveViewIndex = 1;
        }
        SetPreviousData();
    }
Пример #10
0
    private void SetInitialRow()
    {
        DataTable dt = new DataTable();
        DataRow   dr = null;

        dt.Columns.Add(new DataColumn("No.", typeof(string)));
        dt.Columns.Add(new DataColumn("Date", typeof(string)));
        dt.Columns.Add(new DataColumn("Category", typeof(string)));
        dt.Columns.Add(new DataColumn("Type", typeof(string)));
        dt.Columns.Add(new DataColumn("Amount", typeof(string)));
        dt.Columns.Add(new DataColumn("Reason", typeof(string)));
        dt.Columns.Add(new DataColumn("Remarks", typeof(string)));
        dt.Columns.Add(new DataColumn("Image", typeof(string)));
        dr             = dt.NewRow();
        dr["No."]      = 1;
        dr["Date"]     = string.Empty;
        dr["Category"] = string.Empty;
        dr["Type"]     = string.Empty;
        dr["Amount"]   = string.Empty;
        dr["Reason"]   = string.Empty;
        dr["Remarks"]  = string.Empty;
        dr["Image"]    = string.Empty;
        dt.Rows.Add(dr);
        ViewState["CurrentTable"]    = dt;
        Gridview2.DataSource         = dt;
        Gridview2.Columns[8].Visible = false;
        Gridview2.DataBind();
        MultiView1.ActiveViewIndex = 1;
    }
        // --------------------------------------------------------------------------------------------//
        // limpa os gridviews
        // --------------------------------------------------------------------------------------------//
        private void LimparGrid()
        {
            Gridview1.DataSource = null;
            Gridview1.DataBind();

            Gridview2.DataSource = null;
            Gridview2.DataBind();
        }
 // --------------------------------------------------------------------------------------------//
 // inicia os gridviews com a lista informada
 // --------------------------------------------------------------------------------------------//
 protected void BindGridview(List <Segurado> segurados)
 {
     information.Text     = " ";
     information.Visible  = false;
     Gridview1.DataSource = segurados;
     Gridview2.DataSource = segurados[0].LimiteFinanceiro.Modalidades;
     Gridview2.DataBind();
     Gridview1.DataBind();
 }
Пример #13
0
    private void AddNewRowToGrid()
    {
        int rowIndex = 0;

        if (ViewState["CurrentTable"] != null)
        {
            DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
            DataRow   drCurrentRow   = null;
            if (dtCurrentTable.Rows.Count > 0)
            {
                for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
                {
                    TextBox      box1 = (TextBox)Gridview2.Rows[rowIndex].Cells[2].FindControl("TextBox1");
                    DropDownList box2 = (DropDownList)Gridview2.Rows[rowIndex].Cells[3].FindControl("DropDownList1");
                    DropDownList box3 = (DropDownList)Gridview2.Rows[rowIndex].Cells[4].FindControl("DropDownList2");
                    TextBox      box4 = (TextBox)Gridview2.Rows[rowIndex].Cells[5].FindControl("TextBox4");
                    TextBox      box5 = (TextBox)Gridview2.Rows[rowIndex].Cells[6].FindControl("TextBox5");
                    TextBox      box6 = (TextBox)Gridview2.Rows[rowIndex].Cells[7].FindControl("TextBox6");
                    FileUpload   box7 = (FileUpload)Gridview2.Rows[rowIndex].Cells[8].FindControl("FileUpload1");
                    Label        box8 = (Label)Gridview2.Rows[rowIndex].Cells[8].FindControl("Label1");
                    drCurrentRow             = dtCurrentTable.NewRow();
                    drCurrentRow["No."]      = i + 1;
                    drCurrentRow["Date"]     = box1.Text;
                    drCurrentRow["Category"] = box2.Text;
                    drCurrentRow["Type"]     = box3.Text;
                    drCurrentRow["Amount"]   = box4.Text;
                    drCurrentRow["Reason"]   = box5.Text;
                    drCurrentRow["Remarks"]  = box6.Text;
                    string image = box7.FileName;
                    string path  = Server.MapPath("expimage");
                    string apath = path + "\\" + image;
                    box7.SaveAs(apath);
                    string sqlpath = "expimage\\" + image;
                    if (sqlpath != "expimage\\")
                    {
                        drCurrentRow["Image"] = sqlpath;
                    }
                    else
                    {
                        drCurrentRow["Image"] = "";
                    }
                    rowIndex++;
                }
                dtCurrentTable.Rows.Add(drCurrentRow);
                ViewState["CurrentTable"]    = dtCurrentTable;
                Gridview2.DataSource         = dtCurrentTable;
                Gridview2.Columns[8].Visible = true;
                Gridview2.DataBind();
                MultiView1.ActiveViewIndex = 1;
            }
        }
        else
        {
            Response.Write("ViewState is null");
        }
        SetPreviousData();
    }
Пример #14
0
        protected void BindGrid()
        {
            GridView1.DataSource = (DataTable)ViewState["Phone"];
            GridView1.DataBind();

            Gridview2.DataSource = (DataTable)ViewState["Trimester"];
            Gridview2.DataBind();

            grdGradeLevels.DataSource = (DataTable)ViewState["GradeLevel"];
            grdGradeLevels.DataBind();
        }
Пример #15
0
    private void BindGrid()
    {
        SqlDataAdapter da = new SqlDataAdapter("select c_name,email,balance,phone_no from clientdata", c);
        //DataTable dt = new DataTable();
        DataSet ds = new DataSet();

        da.Fill(ds);

        Gridview2.DataSource = ds;
        Gridview2.DataBind();
    }
Пример #16
0
 //项目查询
 private void BindGridView_Projectinfo(string Condition)
 {
     try
     {
         Gridview2.DataSource = prmp.SelectPRMProject(Condition);
         Gridview2.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #17
0
    protected void BindTheData()
    {
        //Response.Write("<script>alert('Binding...')</script>");

        // Gridview1.DataSource = SqlDataSource1;
        //Gridview1.DataBind();

        Gridview2.DataSource = SqlDataSource2;
        Gridview2.DataBind();

        Gridview3.DataSource = SqlDataSource3;
        Gridview3.DataBind();

        Gridview4.DataSource = SqlDataSource4;
        Gridview4.DataBind();
    }
        //Function to Remove rows form Grid
        protected void LinkButton1_Click(object sender, EventArgs e)

        {
            LinkButton lb = (LinkButton)sender;

            GridViewRow gvRow = (GridViewRow)lb.NamingContainer;

            int rowID = gvRow.RowIndex + 1;

            if (Session["ClaimDetails"] != null)

            {
                DataTable dt = (DataTable)Session["ClaimDetails"];

                if (dt.Rows.Count > 1)

                {
                    if (gvRow.RowIndex < dt.Rows.Count - 1)

                    {
                        //Remove the Selected Row data

                        dt.Rows.Remove(dt.Rows[rowID]);
                    }
                }

                //Store the current data in ViewState for future reference

                Session["ClaimDetails"] = dt;

                //Re bind the GridView for the updated data

                Gridview2.DataSource = dt;

                Gridview2.DataBind();

                SetDriverClaimsTableFilledRow();
            }



            //Set Previous Data on Postbacks

            SetPreviousData();
        }
Пример #19
0
    protected void BindTheData()
    {
        //Response.Write("<script>alert('Binding...')</script>");

        // Gridview1.DataSource = SqlDataSource1;
        //Gridview1.DataBind();


        lblStaffName.Text    = DropDownList1.SelectedItem.Text;
        Gridview2.DataSource = SqlDataSource2;
        Gridview2.DataBind();

        Gridview3.DataSource = SqlDataSource3;
        Gridview3.DataBind();

        Gridview4.DataSource = SqlDataSource4;
        Gridview4.DataBind();
    }
    protected void Gridview2_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        Gridview2.EditIndex = -1;
        Label     RECOM_ID    = (Label)Gridview2.Rows[e.RowIndex].FindControl("RECOM_ID");
        Hashtable vHashtable3 = new Hashtable();

        vHashtable3.Add("RECOM_ID", RECOM_ID.Text);
        DataTable dt3 = DBManager.Get(vHashtable3, "GET_RECOMMENDATION_ID");

        Gridview2.DataSource = dt3;
        Gridview2.DataBind();
        Gridview2.HeaderRow.Cells[04].Visible = false;
        foreach (GridViewRow gdr in Gridview2.Rows)
        {
            gdr.Cells[04].Visible = false;
        }
        btnAdd.Visible  = true;
        btnSave.Visible = true;
    }
Пример #21
0
    protected void Gridview2_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Label   IEPMD_ID   = (Label)Gridview2.Rows[e.RowIndex].FindControl("IEPMD_ID");
        TextBox IEPMD_NAME = (TextBox)Gridview2.Rows[e.RowIndex].FindControl("IEPMD_NAME");
        TextBox IEPMD_DESC = (TextBox)Gridview2.Rows[e.RowIndex].FindControl("IEPMD_DESC");

        Hashtable vHashtable = new Hashtable();

        vHashtable.Add("IEPMD_ID", IEPMD_ID.Text);
        vHashtable.Add("IEPMD_NAME", IEPMD_NAME.Text);
        vHashtable.Add("IEPMD_DESC", IEPMD_DESC.Text);
        vHashtable.Add("LAST_USER", vATSession.Login);
        DataRow vDR = RetDR(DBManager.Get(vHashtable, "UPDATE_IEP_MAPPING_DETAIL"));

        Gridview2.EditIndex = -1;
        ShowMsg("Updated Successfully..........");
        DataTable dt3 = DBManager.Get(vHashtable, "UPDATE_IEP_MAPPING_DETAIL");

        Gridview2.DataSource = dt3;
        Gridview2.DataBind();
    }
        //Add New Rows to fill Claims
        private void AddNewRowToGrid()
        {
            int rowIndex = 0;

            if (Session["ClaimDetails"] != null)
            {
                DataTable dtClaimDetails = (DataTable)Session["ClaimDetails"];
                DataRow   drCurrentRow   = null;

                if (dtClaimDetails.Rows.Count > 0 && dtClaimDetails.Rows.Count < 5)
                {
                    for (int i = 1; i <= dtClaimDetails.Rows.Count; i++)
                    {
                        //extract the TextBox values
                        TextBox box1 = (TextBox)Gridview2.Rows[rowIndex].Cells[1].FindControl("TextBox1");
                        TextBox box2 = (TextBox)Gridview2.Rows[rowIndex].Cells[2].FindControl("TextBox2");

                        drCurrentRow = dtClaimDetails.NewRow();
                        drCurrentRow["RowNumber"] = i + 1;

                        dtClaimDetails.Rows[i - 1]["ClaimDescription"] = box1.Text;
                        dtClaimDetails.Rows[i - 1]["ClaimDate"]        = box2.Text;

                        rowIndex++;
                    }
                    dtClaimDetails.Rows.Add(drCurrentRow);
                    Session["ClaimDetails"] = dtClaimDetails;

                    Gridview2.DataSource = dtClaimDetails;
                    Gridview2.DataBind();
                }
            }
            else
            {
                Response.Write("ViewState is null");
            }

            //Set Previous Data on Postbacks
            SetPreviousData();
        }
Пример #23
0
        protected void odswiez()
        {
            string idDzialu = (string)Session["id_dzialu"];
            string txt      = string.Empty;

            DataTable tabelkaGW1 = new DataTable();
            DataTable tabelkaGW2 = new DataTable();
            DataTable tabelkaGW3 = new DataTable();
            DataTable tabelkaGW4 = new DataTable();
            DataTable tabelkaGW5 = new DataTable();
            DataTable tabelkaGW6 = new DataTable();
            DataTable tabelkaGW7 = new DataTable();
            DataTable tabelkaGW8 = new DataTable();

            try
            {
                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 1");
                tabelkaGW1            = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse((string)Session["id_dzialu"]), 1, Date1.Date, Date2.Date, 30, tenPlik);
                Session["tabelka001"] = tabelkaGW1;
                Tabela1.DataSource    = null;
                Tabela1.DataSourceID  = null;
                Tabela1.DataSource    = tabelkaGW1;
                Tabela1.DataBind();

                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 2");
                tabelkaGW2             = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse((string)Session["id_dzialu"]), 2, Date1.Date, Date2.Date, 30, tenPlik);
                Session["tabelka002"]  = tabelkaGW2;
                Gridview2.DataSource   = null;
                Gridview2.DataSourceID = null;
                Gridview2.DataSource   = tabelkaGW2;
                Gridview2.DataBind();

                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 3");
                tabelkaGW3             = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse((string)Session["id_dzialu"]), 3, Date1.Date, Date2.Date, 30, tenPlik);
                Session["tabelka003"]  = tabelkaGW3;
                Gridview3.DataSource   = null;
                Gridview3.DataSourceID = null;
                Gridview3.DataSource   = tabelkaGW3;
                Gridview3.DataBind();
                try
                {
                    //cm.log.Info("OGLR2: wczytywanie danych do tabeli 4");
                    tabelkaGW4            = dr.generuj_dane_do_tabeli_wierszy2018(Date1.Date, Date2.Date, (string)Session["id_dzialu"], 4, 1, 8, tenPlik);
                    Session["tabelka004"] = tabelkaGW4;
                    //pisz("tab_05_", 10, 9, tabela02);
                    tab_05_w01_c1.Text = tabelkaGW4.Rows[0][1].ToString().Trim();
                    tab_05_w01_c2.Text = tabelkaGW4.Rows[0][2].ToString().Trim();
                    tab_05_w01_c3.Text = tabelkaGW4.Rows[0][3].ToString().Trim();
                    tab_05_w01_c4.Text = tabelkaGW4.Rows[0][4].ToString().Trim();
                    tab_05_w01_c5.Text = tabelkaGW4.Rows[0][5].ToString().Trim();
                    tab_05_w01_c6.Text = tabelkaGW4.Rows[0][6].ToString().Trim();
                    tab_05_w01_c7.Text = tabelkaGW4.Rows[0][7].ToString().Trim();
                }
                catch (Exception ex)
                {
                    cm.log.Error(tenPlik + " tabela 4 " + ex.Message);
                }
                try
                {
                    //cm.log.Info("OGLR2: wczytywanie danych do tabeli 5");
                    tabelkaGW5 = dr.generuj_dane_do_tabeli_wierszy2018(Date1.Date, Date2.Date, (string)Session["id_dzialu"], 5, 8, 2, tenPlik);

                    Session["tabelka005"] = tabelkaGW5;
                    tab_06_w01_c01.Text   = tabelkaGW5.Rows[0][1].ToString().Trim();
                    tab_06_w02_c01.Text   = tabelkaGW5.Rows[1][1].ToString().Trim();
                    tab_06_w03_c01.Text   = tabelkaGW5.Rows[2][1].ToString().Trim();
                    tab_06_w04_c01.Text   = tabelkaGW5.Rows[3][1].ToString().Trim();
                    tab_06_w05_c01.Text   = tabelkaGW5.Rows[4][1].ToString().Trim();
                    tab_06_w06_c01.Text   = tabelkaGW5.Rows[5][1].ToString().Trim();
                    tab_06_w07_c01.Text   = tabelkaGW5.Rows[6][1].ToString().Trim();
                }
                catch (Exception ex)
                {
                    cm.log.Error("OGLR2: " + ex.Message);
                }

                try
                {
                    Session["tabelka006"] = dr.tworzTabele(int.Parse((string)Session["id_dzialu"]), 6, Date1.Date, Date2.Date, 30, Gridview6, tenPlik);
                    Gridview6.DataBind();
                }
                catch (Exception ex)
                {
                    cm.log.Error("OGLR2: " + ex.Message);
                }

                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 7");
                Session["tabelka007"] = dr.tworzTabele(int.Parse((string)Session["id_dzialu"]), 7, Date1.Date, Date2.Date, 9, Gridview7, tenPlik);

                Gridview7.DataBind();
            }
            catch (Exception ex)
            {
                cm.log.Error("OGLR2: " + ex.Message);
            }

            // dopasowanie opisów
            makeLabels();

            try
            {
                Label11.Visible    = cl.debug(int.Parse(idDzialu));
                infoLabel2.Visible = cl.debug(int.Parse(idDzialu));

                infoLabel3.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel4.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel5.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel5.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel7.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel8.Visible = cl.debug(int.Parse(idDzialu));
            }
            catch
            {
                Label11.Visible    = false;
                infoLabel2.Visible = false;
                infoLabel3.Visible = false;
                infoLabel4.Visible = false;
                infoLabel5.Visible = false;

                infoLabel6.Visible = false;
                infoLabel7.Visible = false;
                infoLabel8.Visible = false;
            }

            Label11.Text = txt;
            Label3.Text  = cl.nazwaSadu((string)Session["id_dzialu"]);
        }
        //Add newly entered Driver details to the Policy
        public void Button1_Click(object sender, EventArgs e)

        {
            this.btnCalcPremium.Disabled = false;
            if ((Request.Form[txtPolicyStartDate.UniqueID]) == string.Empty)
            {
                this.lblMessage.Text = "Please fill in Required Columns.";
                return;
            }

            if ((Request.Form[this.txtDateOfBirth.UniqueID]) == string.Empty)
            {
                this.lblMessage.Text = "Please fill in Required Columns.";
                return;
            }

            if (txtDriverName.Text == string.Empty)
            {
                this.lblMessage.Text = "Please fill in Required Columns.";
                return;
            }



            int       rowcnt  = 0;
            DataTable Claimdt = new DataTable();

            Claimdt = (DataTable)Session["ClaimDetails"];

            List <DriverDetails> objListDriver = (List <DriverDetails>)Session["DriverLists"];

            DriverDetails obj = new DriverDetails();

            obj.driverName  = this.txtDriverName.Text;
            obj.occupation  = this.lstOccupation.Text;
            obj.dateofbirth = this.txtDateOfBirth.Text;

            obj.claimcount = Gridview2.Rows.Count;

            DataTable DriverClaimDetails = new DataTable();

            DriverClaimDetails = (DataTable)Session["DriverClaimDetails"];

            if (Gridview2.Rows.Count > 0)
            {
                for (rowcnt = 0; rowcnt < Gridview2.Rows.Count; rowcnt++)
                {
                    //extract the TextBox values
                    TextBox box1 = (TextBox)Gridview2.Rows[rowcnt].Cells[1].FindControl("TextBox1");
                    TextBox box2 = (TextBox)Gridview2.Rows[rowcnt].Cells[2].FindControl("TextBox2");


                    obj.claimlist.Add(new ClaimDetails {
                        rownumber = rowcnt + 1, claimdescription = box1.Text.ToString(), claimDate = Convert.ToDateTime(box2.Text)
                    });

                    DataRow dr = null;
                    dr = DriverClaimDetails.NewRow();
                    dr["RowNumber"]         = DriverClaimDetails.Rows.Count;
                    dr["DriverName"]        = this.txtDriverName.Text;
                    dr["DriverOccupation"]  = this.lstOccupation.Text;
                    dr["DriverDateOfBirth"] = this.txtDateOfBirth.Text;
                    dr["ClaimDescription"]  = box1.Text;
                    dr["ClaimDate"]         = box2.Text;
                    DriverClaimDetails.Rows.Add(dr);
                }
            }
            else
            {
                DataRow dr = null;
                dr = DriverClaimDetails.NewRow();
                dr["RowNumber"]         = DriverClaimDetails.Rows.Count;
                dr["DriverName"]        = this.txtDriverName.Text;
                dr["DriverOccupation"]  = this.lstOccupation.Text;
                dr["DriverDateOfBirth"] = this.txtDateOfBirth.Text;
                dr["ClaimDescription"]  = String.Empty;
                dr["ClaimDate"]         = String.Empty;
                DriverClaimDetails.Rows.Add(dr);
            }



            //Store the DataTable in session
            Session["DriverClaimDetails"] = DriverClaimDetails;


            //Method to display Driver with Claim Details as Table data
            SetDriverClaimsTableFilledRow();



            objListDriver.Add(obj);
            Session["DriverLists"] = objListDriver;


            //Reset Driver Details
            this.txtDriverName.Text  = null;
            this.txtDateOfBirth.Text = null;

            if (Claimdt != null)
            {
                for (int i = Claimdt.Rows.Count - 1; i >= 0; i--)
                {
                    DataRow dr = Claimdt.Rows[i];
                    Claimdt.Rows.Remove(dr);
                }
            }

            Gridview2.DataSource = Claimdt;
            Gridview2.DataBind();
            this.Gridview2.Visible = false;


            if (objListDriver.Count == 5)
            {
                this.lblMessage.Text       = "Insurance can have Maximun 5 Drivers only.";
                this.btnAddDriver.Disabled = true;
                this.btnAddClaims.Disabled = true;
                return;
            }
        }
Пример #25
0
 //相应供应商的采购付款详细表
 private void BindGridview2(PMPaymentBillinfo PMPaymentBillinfo)
 {
     Gridview2.DataSource = ppb.SelectPMPaymentIDetail(PMPaymentBillinfo);
     Gridview2.DataBind();
 }
Пример #26
0
 //绑定供应商
 private void BindGridview2(string Condition)
 {
     Gridview2.DataSource = ppl.SelectPMSupplyInfo(Condition);
     Gridview2.DataBind();
 }
Пример #27
0
        protected void odswiez()
        {
            string idDzialu = (string)Session["id_dzialu"];
            //id_dzialu.Text = (string)Session["txt_dzialu"];
            string txt = string.Empty; //

            cl.deleteRowTable();

            try
            {
                DataTable tabelka02 = dr.generuj_dane_do_tabeli_wierszy2018(Date1.Date, Date2.Date, (string)Session["id_dzialu"], 2, 11, 14, tenPlik);
                Session["tabelka002"] = tabelka02;

                //tabela 1
                try
                {
                    cm.log.Info(tenPlik + ": rozpoczęcie tworzenia tabeli 1");

                    DataTable Tabela1 = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse(idDzialu), 1, Date1.Date, Date2.Date, 25, tenPlik);
                    Session["tabelka001"]  = Tabela1;
                    Gridview1.DataSource   = null;
                    Gridview1.DataSourceID = null;
                    Gridview1.DataSource   = Tabela1;
                    Gridview1.DataBind();
                }
                catch (Exception ex)
                {
                    cm.log.Error(tenPlik + " tabela 1  " + ex.Message);
                }

                try
                {
                    cm.log.Info(tenPlik + ": rozpoczęcie tworzenia tabeli 3");

                    DataTable Tabela1 = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse(idDzialu), 3, Date1.Date, Date2.Date, 18, tenPlik);
                    Session["tabelka003"]  = Tabela1;
                    Gridview2.DataSource   = null;
                    Gridview2.DataSourceID = null;
                    Gridview2.DataSource   = Tabela1;
                    Gridview2.DataBind();
                }
                catch (Exception ex)
                {
                    cm.log.Error(tenPlik + " tabela 3 " + ex.Message);
                }
            }
            catch (Exception ex)
            {
                cm.log.Error(tenPlik + ex.Message);
            }

            // dopasowanie opisów
            makeLabels();

            try
            {
                Label11.Visible    = cl.debug(int.Parse(idDzialu));
                infoLabel2.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel3.Visible = cl.debug(int.Parse(idDzialu));
            }
            catch
            {
                Label11.Visible    = false;
                infoLabel2.Visible = false;
                infoLabel3.Visible = false;
            }

            Label11.Text = txt;
            Label3.Text  = cl.nazwaSadu((string)Session["id_dzialu"]);
        }
Пример #28
0
 //采购订单详细表
 private void BindGridview2(PMPurchaseOrderinfo PMPurchaseOrderinfo)
 {
     Gridview2.DataSource = pl.SelectPMPurchaseOrderDetail_look(PMPurchaseOrderinfo);
     Gridview2.DataBind();
 }
Пример #29
0
 protected void gvSelected_PageIndexChanging_g2(object sender, GridViewPageEventArgs e)
 {
     Gridview2.PageIndex = e.NewPageIndex;
     Gridview2.DataBind();
 }
Пример #30
0
 private void BindGriview2(string condition)
 {
     Gridview2.DataSource = psd.SelectProType_Special(condition);
     Gridview2.DataBind();
 }