예제 #1
0
        protected void GetReportImp_Click(object sender, EventArgs e)
        {
            try
            {
                string startdate = Request.Form["minimp"];
                string enddate   = Request.Form["maximp"];
                if (startdate != null && startdate != "" && enddate != null && enddate != "")
                {
                    DataSet Ds = new DataSet();
                    E.Impstartdate = Request.Form["minimp"];
                    E.Impenddate   = Request.Form["maximp"];

                    Ds = E.BeneficiaryBulkImpgridviewFilter(E);
                    SuggestionGridViewImp.DataSource = Ds.Tables[0];
                    SuggestionGridViewImp.DataBind();
                }
                else
                {
                    string myscript = "alert ('Enter Start And End Dates');";

                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", myscript, true);
                }
            }
            catch (Exception e1)
            {
                throw;
            }
        }
예제 #2
0
        public void SuggestionTableView()
        {
            DataSet Ds = new DataSet();

            Ds = E.BeneficiaryBulkEmpgridview("Emp");
            //SuggestionGridView.DataSource = Ds.Tables[0];
            //SuggestionGridView.DataBind();
            //if((Ds !=null) (Ds! ="System.Data.DataRowView"))
            //  {
            SuggestionGridViewEmp.DataSource = Ds.Tables[0];
            SuggestionGridViewEmp.DataBind();
            //GridView1.DataSource = Ds.Tables[0];
            //GridView1.DataBind();

            Ds = E.BeneficiaryBulkImpgridview("");
            SuggestionGridViewImp.DataSource = Ds.Tables[0];
            SuggestionGridViewImp.DataBind();
        }
        protected void impfilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DataTable  GetExcelReportImp = new DataTable("collection");
                DataColumn dtColumn;
                DataRow    dtRow;

                dtColumn            = new DataColumn();
                dtColumn.DataType   = Type.GetType("System.String");
                dtColumn.ColumnName = "IdeaId";

                dtColumn.Caption = "IdeaId";

                GetExcelReportImp.Columns.Add(dtColumn);

                // Create Name column.
                dtColumn            = new DataColumn();
                dtColumn.DataType   = Type.GetType("System.String");
                dtColumn.ColumnName = "IMPL_Members";
                dtColumn.Caption    = "IMPL_Members";
                GetExcelReportImp.Columns.Add(dtColumn);

                // Create CustId column which Reprence Cust Id from
                // The cust Table
                dtColumn            = new DataColumn();
                dtColumn.DataType   = Type.GetType("System.String");
                dtColumn.ColumnName = "DepName";

                dtColumn.Caption = "DepName";

                GetExcelReportImp.Columns.Add(dtColumn);

                // Create Description column.
                dtColumn            = new DataColumn();
                dtColumn.DataType   = Type.GetType("System.String");
                dtColumn.ColumnName = "Date";
                dtColumn.Caption    = "Date";
                GetExcelReportImp.Columns.Add(dtColumn);


                dtColumn            = new DataColumn();
                dtColumn.DataType   = Type.GetType("System.String");
                dtColumn.ColumnName = "BENGrade";
                dtColumn.Caption    = "BENGrade";
                GetExcelReportImp.Columns.Add(dtColumn);


                // Create Description column.
                dtColumn            = new DataColumn();
                dtColumn.DataType   = Type.GetType("System.String");
                dtColumn.ColumnName = "Amount";
                dtColumn.Caption    = "Amount";
                GetExcelReportImp.Columns.Add(dtColumn);


                dtColumn            = new DataColumn();
                dtColumn.DataType   = Type.GetType("System.String");
                dtColumn.ColumnName = "Remark";
                dtColumn.Caption    = "Remark";
                GetExcelReportImp.Columns.Add(dtColumn);



                for (int i = 0; i < SuggestionGridViewImp.Rows.Count; i++) // read data from  gridview
                {
                    dtRow = GetExcelReportImp.NewRow();
                    Label   IdeaId   = (Label)SuggestionGridViewImp.Rows[i].FindControl("Label2"); // get value from lable as well as textbox using id of the elements raja
                    Label   Employee = (Label)SuggestionGridViewImp.Rows[i].FindControl("Label3");
                    Label   Dept     = (Label)SuggestionGridViewImp.Rows[i].FindControl("Label4");
                    Label   Date     = (Label)SuggestionGridViewImp.Rows[i].FindControl("Label5");
                    Label   grade    = (Label)SuggestionGridViewImp.Rows[i].FindControl("Label6");
                    TextBox score    = (TextBox)SuggestionGridViewImp.Rows[i].FindControl("grossamtimp");
                    Label   status   = (Label)SuggestionGridViewImp.Rows[i].FindControl("LblImpRemark");
                    if (impfilter.Text != "select")
                    {
                        if (impfilter.Text == status.Text)
                        {
                            dtRow["IdeaId"]       = IdeaId.Text;
                            dtRow["IMPL_Members"] = Employee.Text;
                            dtRow["DepName"]      = Dept.Text;
                            dtRow["Date"]         = Date.Text;
                            dtRow["BENGrade"]     = grade.Text;
                            dtRow["Amount"]       = score.Text;
                            dtRow["Remark"]       = status.Text;
                            GetExcelReportImp.Rows.Add(dtRow);
                        }
                    }
                }
                SuggestionGridViewImp.DataSource = null;
                SuggestionGridViewImp.DataBind();
                SuggestionGridViewImp.DataSource = GetExcelReportImp;
                SuggestionGridViewImp.DataBind();
            }
            catch (Exception e1)
            {
            }
        }