示例#1
0
    public void bindgrpfp()
    {
        ds.Clear();
        string slq = " select UnivText_code,(select dept_name from Department d where tbl_UnivGrouping.UnivText_code=d.dept_code)dept_name,(select textval from textvaltable t where tbl_UnivGrouping.Univ_code=t.TextCode)as grp  from tbl_UnivGrouping where type='" + ddltype.SelectedItem.Text.ToString() + "' and college_code='" + ddlcollege.SelectedItem.Value.ToString() + "'";

        ds  = da.select_method_wo_parameter(slq, "Text");
        slq = "";
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            FpSpread2.Sheets[0].Rows.Count++;

            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(i + 1);
            // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Text   = Convert.ToString(ds.Tables[0].Rows[i]["dept_name"].ToString());
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Tag    = Convert.ToString(ds.Tables[0].Rows[i]["UnivText_code"].ToString());;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;

            if (slq == "")
            {
                slq = ds.Tables[0].Rows[i][0].ToString();
            }
            else
            {
                slq = slq + "','" + ds.Tables[0].Rows[i][0].ToString();
            }
        }
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddltitlename.SelectedIndex = ddltitlename.Items.IndexOf(ddltitlename.Items.FindByValue(ds.Tables[0].Rows[0][2].ToString()));
        }
        FpSpread2.SaveChanges();
    }
 protected void btnresetclick(object sender, EventArgs e)
 {
     try
     {
         ss2 = "";
         p   = "";
         int a = 0;
         //added by Mullai
         string resetqry  = "update subject set subjectpriority='' where subject_no in(select subject_no from subject s,syllabus_master sm ,sub_sem ss where ss.syll_code=sm.syll_code and sm.syll_code=s.syll_code and ss.syll_code=s.syll_code and ss.subtype_no=s.subtype_no and batch_year='" + Convert.ToString(ddlbatch.SelectedItem.Text) + "' and semester='" + ddlsem.SelectedItem.Text.ToString() + "' and degree_code='" + ddlbranch.SelectedValue.ToString() + "')";
         int    updateqry = d2.update_method_wo_parameter(resetqry, "text");
         //**
         FpSpread2.SaveChanges();
         for (int res = 1; res <= Convert.ToInt32(FpSpread2.Sheets[0].RowCount) - 1; res++)
         {
             int isval = Convert.ToInt32(FpSpread2.Sheets[0].Cells[res, 3].Value);
             if (isval == 1)
             {
                 FpSpread2.Sheets[0].Cells[res, 4].Text   = "";
                 FpSpread2.Sheets[0].Cells[res, 3].Value  = 0;
                 FpSpread2.Sheets[0].Cells[res, 3].Locked = false;
             }
         }
     }
     catch (Exception ex)
     {
         lblerror.Text    = ex.ToString();
         lblerror.Visible = true;
     }
 }
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            int a = 0;
            FpSpread2.SaveChanges();
            for (int res = 1; res <= Convert.ToInt32(FpSpread2.Sheets[0].RowCount) - 1; res++)
            {
                int isval = Convert.ToInt32(FpSpread2.Sheets[0].Cells[res, 3].Value);
                if (isval == 1)
                {
                    string sql = " update subject set subjectpriority='" + FpSpread2.Sheets[0].Cells[res, 4].Text.ToString() + "' where subject_no='" + FpSpread2.Sheets[0].Cells[res, 1].Note.ToString() + "'";
                    a = da.update_method_wo_parameter(sql, "Text");
                }
            }

            if (a == 1)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientScript", "alert('Saved successfully')", true);
            }
        }
        catch (Exception ex)
        {
            lblerror.Text    = ex.ToString();
            lblerror.Visible = true;
        }
    }
 protected void btnresetclick(object sender, EventArgs e)
 {
     try
     {
         ss2 = "";
         p   = "";
         int a = 0;
         FpSpread2.SaveChanges();
         for (int res = 1; res <= Convert.ToInt32(FpSpread2.Sheets[0].RowCount) - 1; res++)
         {
             int isval = Convert.ToInt32(FpSpread2.Sheets[0].Cells[res, 3].Value);
             if (isval == 1)
             {
                 FpSpread2.Sheets[0].Cells[res, 4].Text   = "";
                 FpSpread2.Sheets[0].Cells[res, 3].Value  = 0;
                 FpSpread2.Sheets[0].Cells[res, 3].Locked = false;
             }
         }
     }
     catch (Exception ex)
     {
         lblerror.Text    = ex.ToString();
         lblerror.Visible = true;
     }
 }
示例#5
0
    protected void btnfpspread1delete_Click1(object sender, EventArgs e)
    {
        int    a   = 0;
        string sql = " delete from Grade_Master where Degree_Code='" + ddlbranch.SelectedItem.Value.ToString() + "' and batch_year='" + ddlbatch.SelectedItem.Text.ToString() + "' and College_Code='" + Session["collegecode"].ToString() + "'";

        a = da.update_method_wo_parameter(sql, "Text");

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientScript", "alert('Deleted successfully')", true);
        FpSpread2.Sheets[0].RowCount = 0;
        FpSpread2.SaveChanges();
    }
示例#6
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        FpSpread2.SaveChanges();
        int rcount = FpSpread2.Sheets[0].RowCount++;

        FpSpread2.Sheets[0].ColumnCount = 4;


        FpSpread2.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
        FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Size = FontUnit.Medium;
        FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Name = "Book Antiqua";
        FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Bold = true;
        FpSpread2.Sheets[0].DefaultStyle.Font.Name = "Book Antiqua";
        FpSpread2.Sheets[0].DefaultStyle.Font.Bold = false;
        FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.ForeColor = Color.White;

        FpSpread2.Sheets[0].Columns[0].HorizontalAlign = HorizontalAlign.Center;
        FpSpread2.Sheets[0].Columns[1].HorizontalAlign = HorizontalAlign.Center;

        FarPoint.Web.Spread.DoubleCellType intgrcell = new FarPoint.Web.Spread.DoubleCellType();
        intgrcell.FormatString = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals.ToString();
        intgrcell.MaximumValue = Convert.ToInt32(100);
        intgrcell.MinimumValue = 0;
        intgrcell.ErrorMessage = "Enter valid Number";
        FpSpread2.Sheets[0].Columns[0].CellType = intgrcell;
        FpSpread2.Sheets[0].Columns[1].CellType = intgrcell;
        FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Size = FontUnit.Medium;
        int minustwo = FpSpread2.Sheets[0].RowCount - 2;

        if (rcount != 0)
        {
            if (FpSpread2.Sheets[0].Cells[minustwo, 1].Text.ToString() != "" && FpSpread2.Sheets[0].Cells[minustwo, 0].Text.ToString() != "" && FpSpread2.Sheets[0].Cells[minustwo, 2].Text.ToString() != "")
            {
                double temp = Convert.ToDouble(FpSpread2.Sheets[0].Cells[minustwo, 1].Text.ToString());
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].CellType = intgrcell;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].Text     = Convert.ToString(temp);
                //FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].HorizontalAlign = HorizontalAlign.Center;
            }
            else
            {
                FpSpread2.Sheets[0].RowCount--;
            }
        }
        else
        {
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].CellType = intgrcell;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].Text     = "00.00";
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].CellType = intgrcell;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].Text     = "00.00";
        }
    }
示例#7
0
    protected void btnSaveIsFinalYear_Click(object sender, EventArgs e)
    {
        try
        {
            int aa = 0;
            FpSpread2.SaveChanges();
            int selectedcount = 0;
            for (int res = 1; res <= Convert.ToInt32(FpSpread2.Sheets[0].RowCount) - 1; res++)
            {
                int isval = Convert.ToInt32(FpSpread2.Sheets[0].Cells[res, 6].Value);
                if (isval == 1)
                {
                    selectedcount++;
                }
            }

            if ((ddlMonth.SelectedValue.ToString() != "0") && (ddlYear.SelectedValue.ToString() != "0"))
            {
                FpSpread2.SaveChanges();
                for (int res = 1; res <= Convert.ToInt32(FpSpread2.Sheets[0].RowCount) - 1; res++)
                {
                    int isval = 0;
                    isval = Convert.ToInt32(FpSpread2.Sheets[0].Cells[res, 6].Value);
                    if (isval == 1)
                    {
                        string publishid = FpSpread2.Sheets[0].Cells[res, 4].Tag.ToString();
                        string sql       = "update publishresult set isFinalYear='1' where publishid='" + publishid + "'";
                        aa = da.update_method_wo_parameter(sql, "Text");
                    }
                    else
                    {
                        string publishid = FpSpread2.Sheets[0].Cells[res, 4].Tag.ToString();
                        string sql       = "update publishresult set isFinalYear='0' where publishid='" + publishid + "'";
                        aa = da.update_method_wo_parameter(sql, "Text");
                    }
                }
                if (aa > 0)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('Update Successfully')", true);
                    loadfp();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
 protected void btndeletefp2_Click(object sender, EventArgs e)
 {
     try
     {
         string data = "";
         FpSpread2.SaveChanges();
         for (int iy = 1; iy < FpSpread2.Sheets[0].RowCount; iy++)
         {
             if (Convert.ToInt32(FpSpread2.Sheets[0].Cells[iy, 3].Value) == 0)
             {
                 if (data == "")
                 {
                     data = FpSpread2.Sheets[0].Cells[iy, 2].Text.ToString() + "-" + FpSpread2.Sheets[0].Cells[iy, 1].Tag.ToString();
                 }
                 else
                 {
                     data = data + ";" + FpSpread2.Sheets[0].Cells[iy, 2].Text.ToString() + "-" + FpSpread2.Sheets[0].Cells[iy, 1].Tag.ToString();
                 }
             }
         }
         if (data != "")
         {
             sql = "update IM_POSettings set FooterDescStaff='" + data + "'  where collegecode='" + Session["collegecode"].ToString() + "' ";
             int a = da.update_method_wo_parameter(sql, "text");
         }
         else
         {
             sql = "select * from IM_POSettings ";
             ds.Clear();
             ds = da.select_method_wo_parameter(sql, "Text");
             if (ds.Tables[0].Rows.Count > 0)
             {
                 sql = "update IM_POSettings set FooterDescStaff=''  where collegecode='" + Session["collegecode"].ToString() + "' ";
                 int a = da.update_method_wo_parameter(sql, "text");
             }
         }
         showstaffdesc();
     }
     catch
     {
     }
 }
 protected void btndelete_Click(object sender, EventArgs e)
 {
     try
     {
         FpSpread2.SaveChanges();
         Boolean saveflag = false;
         string  strquery = "";
         int     savval   = 0;
         for (int i = 0; i < FpSpread2.Sheets[0].RowCount; i++)
         {
             int isval = Convert.ToInt32(FpSpread2.Sheets[0].Cells[i, 6].Value);
             if (isval > 0)
             {
                 saveflag = true;
                 string subno = FpSpread2.Sheets[0].Cells[i, 5].Tag.ToString();
                 strquery = "delete from tbl_equal_subject_Grade_System where exam_year='" + ddlexamyear.SelectedValue.ToString() + "' and exam_month='" + ddlmonth.SelectedValue.ToString() + "' and Common_Subject_no='" + subno + "'";
                 savval   = d2.update_method_wo_parameter(strquery, "Text");
             }
         }
         if (saveflag == true)
         {
             ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientScript", "alert('Deleted Successfully!')", true);
             LoadDetails();
         }
         else
         {
             errmsg.Visible = true;
             errmsg.Text    = "Please Select The Equal Subject And Than Proceed";
             return;
         }
     }
     catch (Exception ex)
     {
         errmsg.Visible = true;
         errmsg.Text    = ex.ToString();
     }
 }
示例#10
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            int a = 0;
            FpSpread2.SaveChanges();
            string sql = " delete from Grade_Master where Degree_Code='" + ddlbranch.SelectedItem.Value.ToString() + "' and batch_year='" + ddlbatch.SelectedItem.Text.ToString() + "' and College_Code='" + Session["collegecode"].ToString() + "'";
            a = da.update_method_wo_parameter(sql, "Text");
            string Mark_Grade = "", Frange = "", Trange = "", Credit_Points = "", batch_year = "", Degree_Code = "", College_Code = "";
            for (int res = 0; res < FpSpread2.Sheets[0].RowCount; res++)
            {
                if (FpSpread2.Sheets[0].Cells[res, 0].Text.ToString() != "" && FpSpread2.Sheets[0].Cells[res, 1].Text.ToString() != "" && FpSpread2.Sheets[0].Cells[res, 2].Text.ToString() != "" && FpSpread2.Sheets[0].Cells[res, 3].Text.ToString() != "")
                {
                    Frange        = FpSpread2.Sheets[0].Cells[res, 0].Text.ToString();
                    Trange        = FpSpread2.Sheets[0].Cells[res, 1].Text.ToString();
                    Credit_Points = FpSpread2.Sheets[0].Cells[res, 2].Text.ToString();
                    Mark_Grade    = FpSpread2.Sheets[0].Cells[res, 3].Text.ToString();

                    batch_year   = ddlbatch.SelectedItem.Text.ToString();
                    Degree_Code  = ddlbranch.SelectedItem.Value.ToString();
                    College_Code = Session["collegecode"].ToString();
                    sql          = " insert into Grade_Master (Mark_Grade,Frange,Trange,Credit_Points,batch_year,Degree_Code,College_Code) values ('" + Mark_Grade + "','" + Frange + "','" + Trange + "','" + Credit_Points + "','" + batch_year + "','" + Degree_Code + "','" + College_Code + "')";
                    a            = da.update_method_wo_parameter(sql, "Text");
                }
            }

            if (a == 1)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientScript", "alert('Saved successfully')", true);
            }
        }
        catch (Exception ex)
        {
            lblerror.Text    = ex.ToString();
            lblerror.Visible = true;
        }
    }
示例#11
0
    protected void btn_importex(object sender, EventArgs e)
    {
        try
        {
            lblerror.Visible = false;

            Boolean rollflag  = false;
            Boolean stro      = false;
            string  errorroll = "";
            int     getstuco  = 0;
            FpSpread2.SaveChanges();
            if (fpmarkexcel.FileName != "" && fpmarkexcel.FileName != null)
            {
                if (fpmarkexcel.FileName.EndsWith(".xls") || fpmarkexcel.FileName.EndsWith(".xlsx"))
                {
                    using (Stream stream = this.fpmarkexcel.FileContent as Stream)
                    {
                        stream.Position = 0;
                        this.fpmarkimport.OpenExcel(stream);
                        fpmarkimport.OpenExcel(stream);
                        fpmarkimport.SaveChanges();
                    }
                    FpSpread2.Sheets[0].Rows.Count = fpmarkimport.Sheets[0].RowCount - 1;
                    for (int c = 0; c < fpmarkimport.Sheets[0].ColumnCount; c++)
                    {
                        string gettest = fpmarkimport.Sheets[0].Cells[0, c].Text.ToString().Trim().ToLower();
                        for (int g = 0; g < FpSpread2.Sheets[0].ColumnCount; g++)
                        {
                            string settest = FpSpread2.Sheets[0].ColumnHeader.Cells[0, g].Text.ToString().Trim().ToLower();
                            if (settest == gettest)
                            {
                                for (int i = 1; i < fpmarkimport.Sheets[0].RowCount; i++)
                                {
                                    string markval = fpmarkimport.Sheets[0].Cells[i, g].Text.ToString().Trim().ToLower();
                                    FpSpread2.Sheets[0].Cells[i - 1, g].Text = markval.ToUpper();
                                }
                                stro = true;
                            }
                        }
                    }
                    if (stro == true)
                    {
                        if (errorroll == "")
                        {
                            ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('Imported Successfully')", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('Test Not Exists')", true);
                    }
                }
                else
                {
                    lblerror.Visible = true;
                    lblerror.Text    = "Please Select The File and Then Proceed";
                }
            }
            else
            {
                lblerror.Visible = true;
                lblerror.Text    = "Please Select The File and Then Proceed";
            }
            fpmarkimport.Visible = false;
            FpSpread2.SaveChanges();
        }
        catch (Exception ex)
        {
            lblerror.Text    = ex.ToString();
            lblerror.Visible = true;
        }
    }
    protected void Buttongo_Click(object sender, EventArgs e)
    {
        try
        {
            ss2 = "";
            p   = "";
            FpSpread2.Visible                    = false; btnreset.Visible = false;
            FpSpread2.CommandBar.Visible         = false;
            FpSpread2.Sheets[0].RowCount         = 0;
            FpSpread2.Sheets[0].ColumnCount      = 5;
            FpSpread2.Sheets[0].Columns[0].Width = 40;
            FpSpread2.Sheets[0].Columns[1].Width = 113;
            FpSpread2.Sheets[0].Columns[2].Width = 342;
            FpSpread2.Sheets[0].Columns[3].Width = 83;
            FpSpread2.Sheets[0].Columns[4].Width = 90;

            FpSpread2.Sheets[0].Columns[0].Locked = true;
            FpSpread2.Sheets[0].Columns[1].Locked = true;
            FpSpread2.Sheets[0].Columns[2].Locked = true;
            FpSpread2.Sheets[0].Columns[4].Locked = true;

            FpSpread2.Sheets[0].Columns[0].HorizontalAlign = HorizontalAlign.Center;
            FpSpread2.Sheets[0].Columns[3].HorizontalAlign = HorizontalAlign.Center;
            FpSpread2.Sheets[0].Columns[4].HorizontalAlign = HorizontalAlign.Center;

            FpSpread2.Sheets[0].RowHeader.Visible      = false;
            FpSpread2.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Name = "Book Antiqua";
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Bold = true;
            FpSpread2.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].DefaultStyle.Font.Name = "Book Antiqua";
            FpSpread2.Sheets[0].SheetCorner.RowCount   = 2;

            FpSpread2.Sheets[0].ColumnHeaderSpanModel.Add(0, 0, 2, 1);
            FpSpread2.Sheets[0].ColumnHeaderSpanModel.Add(0, 1, 2, 1);
            FpSpread2.Sheets[0].ColumnHeaderSpanModel.Add(0, 2, 2, 1);
            FpSpread2.Sheets[0].ColumnHeaderSpanModel.Add(0, 3, 2, 1);
            FpSpread2.Sheets[0].ColumnHeaderSpanModel.Add(0, 4, 2, 1);

            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 1].Text = "Subject Code";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Subject Name";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 3].Text = "Select";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 4].Text = "Priority";

            FarPoint.Web.Spread.TextCellType txt = new FarPoint.Web.Spread.TextCellType();

            FarPoint.Web.Spread.CheckBoxCellType chkcell = new FarPoint.Web.Spread.CheckBoxCellType();
            FpSpread2.Sheets[0].RowCount = 0;
            FarPoint.Web.Spread.CheckBoxCellType chkcell1 = new FarPoint.Web.Spread.CheckBoxCellType();
            FpSpread2.Sheets[0].RowCount = FpSpread2.Sheets[0].RowCount + 1;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].CellType        = chkcell1;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Locked          = true;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 4].HorizontalAlign = HorizontalAlign.Center;
            FpSpread2.Sheets[0].FrozenRowCount = 1;
            chkcell1.AutoPostBack            = true;
            chkcell.AutoPostBack             = true;
            FpSpread2.Sheets[0].AutoPostBack = false;


            string batchyear    = ddlbatch.SelectedValue.ToString();
            string degreecode   = ddlbranch.SelectedValue.ToString();
            string year         = ddlbatch.SelectedValue.ToString();
            string degree       = ddldegree.SelectedItem.ToString();
            string course       = ddldegree.SelectedItem.ToString();
            string depart_code  = ddlbranch.SelectedValue.ToString();
            string batchyearatt = ddlbatch.SelectedValue.ToString();
            string studinfo     = "";
            //studinfo = "select distinct s.subject_no,subject_code,subject_name,subject_type,ss.subtype_no,subjectpriority from subject s,syllabus_master sm ,sub_sem ss where ss.syll_code=sm.syll_code and sm.syll_code=s.syll_code and ss.syll_code=s.syll_code and ss.subtype_no=s.subtype_no and batch_year='" + ddlbatch.SelectedItem.Text.ToString() + "' and semester='" + ddlsem.SelectedItem.Text.ToString() + "' and degree_code='" + depart_code + "' and ss.subtype_no='" + ddlsubtype.SelectedItem.Value.ToString() + "'";
            studinfo = "select distinct s.subject_no,subject_code,subject_name,subject_type,ss.subtype_no,subjectpriority from subject s,syllabus_master sm ,sub_sem ss where ss.syll_code=sm.syll_code and sm.syll_code=s.syll_code and ss.syll_code=s.syll_code and ss.subtype_no=s.subtype_no and batch_year='" + ddlbatch.SelectedItem.Text.ToString() + "' and semester='" + ddlsem.SelectedItem.Text.ToString() + "' and degree_code='" + depart_code + "' order by  subject_code ";

            DataSet dsstudinfo = da.select_method_wo_parameter(studinfo, "Text");
            if (dsstudinfo.Tables[0].Rows.Count > 0)
            {
                btnsave.Visible = true;

                int sno = 0;
                for (int studcount = 0; studcount < dsstudinfo.Tables[0].Rows.Count; studcount++)
                {
                    string regno    = "";
                    string studname = "";
                    string rollno   = "";
                    FpSpread2.Visible = true;
                    sno++;


                    FpSpread2.Sheets[0].RowCount = FpSpread2.Sheets[0].RowCount + 1;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].Text     = sno + "";
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].CellType = txt;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].Text     = dsstudinfo.Tables[0].Rows[studcount]["subject_code"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].Note     = dsstudinfo.Tables[0].Rows[studcount]["subject_no"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = txt;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].Text     = dsstudinfo.Tables[0].Rows[studcount]["subject_name"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].Text     = dsstudinfo.Tables[0].Rows[studcount]["subject_name"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 4].Text     = dsstudinfo.Tables[0].Rows[studcount]["subjectpriority"].ToString();;
                    if (FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 4].Text.Trim() != "")
                    {
                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Locked = true;
                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Value  = 1;
                        btnreset.Visible = true;
                    }
                    else
                    {
                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Locked = false;
                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Value  = 0;
                        btnreset.Visible = false;
                    }
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].CellType = chkcell;
                }
            }
            else
            {
                clear();
                lblerror.Text    = "No Records Found";
                lblerror.Visible = true;
            }
            string totalrows = FpSpread2.Sheets[0].RowCount.ToString();
            FpSpread2.Sheets[0].PageSize = (Convert.ToInt32(totalrows) * 20) + 40;
            FpSpread2.Height             = (Convert.ToInt32(totalrows) * 50) + 40;
            FpSpread2.SaveChanges();
        }
        catch (Exception ex)
        {
            lblerror.Text    = ex.ToString();
            lblerror.Visible = true;
        }
    }
    protected void Buttongo_Click(object sender, EventArgs e)
    {
        try
        {
            lblvalidation1.Text = "";
            ss2 = "";
            p   = "";
            FpSpread2.Visible                    = false; btnreset.Visible = false;
            FpSpread2.CommandBar.Visible         = false;
            FpSpread2.Sheets[0].RowCount         = 0;
            FpSpread2.Sheets[0].ColumnCount      = 5;
            FpSpread2.Sheets[0].Columns[0].Width = 40;
            FpSpread2.Sheets[0].Columns[1].Width = 113;
            FpSpread2.Sheets[0].Columns[2].Width = 342;
            FpSpread2.Sheets[0].Columns[3].Width = 83;
            FpSpread2.Sheets[0].Columns[4].Width = 90;

            FpSpread2.Sheets[0].RowHeader.Visible      = false;
            FpSpread2.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Name = "Book Antiqua";
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Bold = true;
            FpSpread2.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].DefaultStyle.Font.Name = "Book Antiqua";

            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 1].Text = "Reg.No.";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Student Name";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 3].Text = "Total Papers Selected";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 4].Text = "Total Papers Appeared";

            FpSpread2.Sheets[0].Columns[0].Locked = true;
            FpSpread2.Sheets[0].Columns[1].Locked = true;
            FpSpread2.Sheets[0].Columns[2].Locked = true;
            FpSpread2.Sheets[0].Columns[4].Locked = true;

            FpSpread2.Sheets[0].Columns[0].VerticalAlign = VerticalAlign.Middle;
            FpSpread2.Sheets[0].Columns[1].VerticalAlign = VerticalAlign.Middle;
            FpSpread2.Sheets[0].Columns[2].VerticalAlign = VerticalAlign.Middle;
            FpSpread2.Sheets[0].Columns[3].VerticalAlign = VerticalAlign.Middle;
            FpSpread2.Sheets[0].Columns[4].VerticalAlign = VerticalAlign.Middle;

            FpSpread2.Sheets[0].Columns[0].HorizontalAlign = HorizontalAlign.Center;
            FpSpread2.Sheets[0].Columns[1].HorizontalAlign = HorizontalAlign.Left;
            FpSpread2.Sheets[0].Columns[2].HorizontalAlign = HorizontalAlign.Left;
            FpSpread2.Sheets[0].Columns[3].HorizontalAlign = HorizontalAlign.Center;
            FpSpread2.Sheets[0].Columns[4].HorizontalAlign = HorizontalAlign.Center;

            loadheader();

            FarPoint.Web.Spread.TextCellType txt = new FarPoint.Web.Spread.TextCellType();

            FarPoint.Web.Spread.CheckBoxCellType chkcell = new FarPoint.Web.Spread.CheckBoxCellType();
            FpSpread2.Sheets[0].RowCount = 0;
            FarPoint.Web.Spread.CheckBoxCellType chkcell1 = new FarPoint.Web.Spread.CheckBoxCellType();

            chkcell1.AutoPostBack            = true;
            chkcell.AutoPostBack             = true;
            FpSpread2.Sheets[0].AutoPostBack = true;

            DataSet printds      = new DataSet();
            string  batchyear    = ddlbatch.SelectedValue.ToString();
            string  degreecode   = ddlbranch.SelectedValue.ToString();
            string  year         = ddlbatch.SelectedValue.ToString();
            string  degree       = ddldegree.SelectedItem.ToString();
            string  course       = ddldegree.SelectedItem.ToString();
            string  depart_code  = ddlbranch.SelectedValue.ToString();
            string  batchyearatt = ddlbatch.SelectedValue.ToString();
            string  studinfo     = "";
            studinfo = "select Stud_Name,Roll_No,Reg_No,APP_No from Registration  where Batch_Year='" + ddlbatch.SelectedItem.Text.ToString() + "' and degree_code='" + depart_code + "' and DelFlag=0 and Exam_Flag<>'DEBAR' order by Reg_No  ; select m.roll_no,ed.Exam_year,ed.Exam_Month,m.subject_no,m.internal_mark,m.external_mark,m.total,m.result from mark_entry m,Exam_Details ed where ed.exam_code=m.exam_code and ed.batch_year='" + ddlbatch.SelectedItem.Text.ToString() + "' and ed.degree_code='" + depart_code + "' order by m.roll_no,m.subject_no,ed.Exam_year,ed.Exam_Month";
            studinfo = studinfo + " select r.Roll_No,Count(distinct sc.subject_no) subcount from Registration r,subjectChooser sc where r.Roll_No=sc.roll_no and r.Batch_Year='" + ddlbatch.SelectedItem.Text.ToString() + "' and r.degree_code='" + depart_code + "' and DelFlag=0 and Exam_Flag<>'DEBAR' group by r.Roll_No";
            studinfo = studinfo + " select r.Roll_No,Count(distinct m.subject_no) subcount from Registration r,mark_entry m,subjectChooser sc where r.Roll_No=m.roll_no and r.Roll_No=sc.roll_no and sc.subject_no=m.subject_no and sc.roll_no=m.roll_no and r.Batch_Year='" + ddlbatch.SelectedItem.Text.ToString() + "' and r.degree_code='" + depart_code + "' and DelFlag=0 and Exam_Flag<>'DEBAR' group by r.Roll_No";

            dsstudinfo = da.select_method_wo_parameter(studinfo, "Text");
            dv         = new DataView();
            if (dsstudinfo.Tables[0].Rows.Count > 0)
            {
                btnsave.Visible   = false;
                FpSpread2.Visible = true;
                btnPrint.Visible  = true;
                int sno = 0;
                for (int studcount = 0; studcount < dsstudinfo.Tables[0].Rows.Count; studcount++)
                {
                    sno++;
                    string roll_no = dsstudinfo.Tables[0].Rows[studcount]["Roll_No"].ToString();

                    FpSpread2.Sheets[0].RowCount++;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].Text     = sno + "";
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].CellType = txt;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].Text     = dsstudinfo.Tables[0].Rows[studcount]["Reg_No"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].Note     = dsstudinfo.Tables[0].Rows[studcount]["Roll_No"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = txt;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].Text     = dsstudinfo.Tables[0].Rows[studcount]["Stud_Name"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].Tag      = dsstudinfo.Tables[0].Rows[studcount]["APP_No"].ToString();

                    int noofsubject = 0;
                    dsstudinfo.Tables[2].DefaultView.RowFilter = "roll_no='" + roll_no + "'";
                    dv = dsstudinfo.Tables[2].DefaultView;
                    if (dv.Count > 0)
                    {
                        noofsubject = Convert.ToInt32(dv[0]["subcount"].ToString());
                    }
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Text = noofsubject.ToString();

                    noofsubject = 0;
                    dsstudinfo.Tables[3].DefaultView.RowFilter = "roll_no='" + roll_no + "'";
                    dv = dsstudinfo.Tables[3].DefaultView;
                    if (dv.Count > 0)
                    {
                        noofsubject = Convert.ToInt32(dv[0]["subcount"].ToString());
                    }
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 4].Text = noofsubject.ToString();

                    int startrow = FpSpread2.Sheets[0].RowCount;
                    for (int i = 5; i < FpSpread2.Sheets[0].Columns.Count; i++)
                    {
                        string strm_y  = "";
                        int    noofrow = startrow;

                        string subject_no = FpSpread2.Sheets[0].ColumnHeader.Cells[0, i].Tag.ToString();
                        dsstudinfo.Tables[1].DefaultView.RowFilter = "roll_no='" + roll_no + "' and subject_no='" + subject_no + "'";
                        dv = dsstudinfo.Tables[1].DefaultView;

                        for (int k = 0; k < dv.Count; k++)
                        {
                            int    e_month      = Convert.ToInt32(dv[k]["Exam_Month"].ToString());
                            string e_year       = dv[k]["Exam_year"].ToString();
                            string strMonthName = CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedMonthGenitiveNames[e_month - 1];
                            strMonthName = e_year + "-" + strMonthName;
                            string strintmark = dv[k]["internal_mark"].ToString();
                            if (strintmark.Trim() == "-1")
                            {
                                strintmark = "AB";
                            }
                            else if (strintmark.Trim() == "-2")
                            {
                                strintmark = "NE";
                            }
                            else if (strintmark.Trim() == "-3")
                            {
                                strintmark = "NR";
                            }

                            string strextmark = dv[k]["external_mark"].ToString();
                            if (strextmark.Trim() == "-1")
                            {
                                strextmark = "AB";
                            }
                            else if (strextmark.Trim() == "-2")
                            {
                                strextmark = "NE";
                            }
                            else if (strextmark.Trim() == "-3")
                            {
                                strextmark = "NR";
                            }

                            if (strm_y.Trim() == "")
                            {
                                strm_y = strMonthName + "-" + strintmark + "," + strextmark;
                            }
                            else
                            {
                                strm_y = strm_y + " " + strMonthName + "-" + strintmark + "," + strextmark;
                                noofrow++;
                                if (FpSpread2.Sheets[0].RowCount < noofrow)
                                {
                                    FpSpread2.Sheets[0].RowCount++;
                                    FpSpread2.Sheets[0].Rows[FpSpread2.Sheets[0].RowCount - 2].Border.BorderColorBottom = Color.White;
                                }
                            }
                            FpSpread2.Sheets[0].Cells[noofrow - 1, i].Text = strMonthName + "-" + strintmark + "," + strextmark;
                        }
                    }
                }
                dsstudinfo.Clear();
                dsstudinfo.Dispose();
                rptprint.Visible = true;
            }
            else
            {
                clear();
                lblerror.Text    = "No Records Found";
                lblerror.Visible = true;
            }
            string totalrows = FpSpread2.Sheets[0].RowCount.ToString();
            FpSpread2.Sheets[0].PageSize = (Convert.ToInt32(totalrows) * 20) + 40;
            FpSpread2.Height             = (Convert.ToInt32(totalrows) * 50) + 40;

            FpSpread2.Sheets[0].Columns[0].Width = 40;
            FpSpread2.Sheets[0].Columns[1].Width = 113;
            FpSpread2.Sheets[0].Columns[2].Width = 342;
            FpSpread2.Sheets[0].Columns[3].Width = 83;
            FpSpread2.Sheets[0].Columns[4].Width = 90;
            FpSpread2.Sheets[0].PageSize         = FpSpread2.Sheets[0].RowCount;
            FpSpread2.SaveChanges();
            FpSpread2.Visible = true;
        }
        catch (Exception ex)
        {
            lblerror.Text    = ex.ToString();
            lblerror.Visible = true;
        }
    }
示例#14
0
    protected void Btnmoveleft_OnClick(object sender, EventArgs e)
    {
        lblgrperr.Visible = false;
        FpSpread2.SaveChanges();
        int       cccheck = 0;
        DataTable dt      = new DataTable();

        dt.Columns.Add("Sno");
        dt.Columns.Add("Deptname");
        dt.Columns.Add("UnivText_code");
        dt.Rows.Clear();
        DataTable dt1 = new DataTable();

        dt1.Columns.Add("Sno");
        dt1.Columns.Add("Deptname");
        dt1.Columns.Add("UnivText_code");
        dt1.Rows.Clear();

        for (int iy = 1; iy < FpSpread2.Sheets[0].RowCount; iy++)
        {
            if (Convert.ToInt32(FpSpread2.Sheets[0].Cells[iy, 2].Value) == 0)
            {
                dt.Rows.Add(Convert.ToString(dt.Rows.Count + 1), FpSpread2.Sheets[0].Cells[iy, 1].Text.ToString(), FpSpread2.Sheets[0].Cells[iy, 1].Tag.ToString());
            }
            else
            {
                dt1.Rows.Add(Convert.ToString(dt1.Rows.Count + 1), FpSpread2.Sheets[0].Cells[iy, 1].Text.ToString(), FpSpread2.Sheets[0].Cells[iy, 1].Tag.ToString());
                cccheck++;
            }
            //  FpSpread2.Sheets[0].Cells[iy, 2].Value = 0;
        }
        if (dt.Rows.Count > 0)
        {
            //FpSpread2.DataSource = dt;
            //FpSpread2.DataBind();
            FpSpread2.Sheets[0].Rows.Count = 0;
            FpSpread2.Sheets[0].Rows.Count++;
            FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = chkboxsel_all;
            chkboxsel_all.AutoPostBack = true;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                FpSpread2.Sheets[0].Rows.Count++;

                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(dt.Rows[i][0].ToString());
                // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Text   = Convert.ToString(dt.Rows[i][1].ToString());
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Tag    = Convert.ToString(dt.Rows[i][2].ToString());;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;
            }
        }
        else
        {
            FpSpread2.Sheets[0].RowCount = 0;
            FpSpread2.SaveChanges();
        }
        if (dt1.Rows.Count > 0)
        {
            //FpSpread2.DataSource = dt;
            //FpSpread2.DataBind();
            if (FpSpread1.Sheets[0].Rows.Count == 0)
            {
                FpSpread1.Sheets[0].Rows.Count++;
                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].CellType = chkboxsel_all;
                chkboxsel_all.AutoPostBack = true;
            }

            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                FpSpread1.Sheets[0].Rows.Count++;

                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(FpSpread1.Sheets[0].Rows.Count - 1);
                // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 1].Text   = Convert.ToString(dt1.Rows[i][1].ToString());
                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 1].Tag    = Convert.ToString(dt1.Rows[i][2].ToString());;
                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;
            }
            FpSpread1.Sheets[0].PageSize = FpSpread1.Sheets[0].RowCount;

            FpSpread1.SaveChanges();
        }

        FpSpread2.Sheets[0].PageSize = FpSpread2.Sheets[0].RowCount;
        FpSpread2.SaveChanges();

        FpSpread2.Visible = true;
        if (cccheck == 0)
        {
            lblgrperr.Text    = "Please Select Atleast One Department";
            lblgrperr.Visible = true;
        }
        else
        {
            lblgrperr.Visible = false;
        }
    }
示例#15
0
    protected void btngo_Click(object sender, EventArgs e)
    {
        try
        {
            lblerrmsg2.Text = "";
            lblgrperr.Text  = "";
            ds.Dispose();
            ds = da.select_method("select * from sysobjects where name='tbl_UnivGrouping' and Type='U'", hat, "text ");
            if (ds.Tables[0].Rows.Count > 0)
            {
            }
            else
            {
                int p = da.insert_method(" create table tbl_UnivGrouping (Univ_code nvarchar(100),UnivText_code nvarchar(100),type nvarchar(100),college_code nvarchar(100))", hat, "text");
            }
            hide();
            lblerrormsg.Visible = true;
            FpSpread2.Sheets[0].RowHeader.Visible = false;
            FpSpread2.Sheets[0].Rows.Count        = 0;
            FpSpread2.SaveChanges();
            FpSpread2.CommandBar.Visible = false;
            string groupnn = "";
            if (ddltitlename.Items.Count > 0)
            {
                groupnn = ddltitlename.SelectedItem.Value.ToString();
                groupnn = " and Univ_code ='" + groupnn + "'";
            }
            else
            {
                lblerrmsg2.Text    = "Please Create Atleast One group";
                lblerrmsg2.Visible = true;
                return;
            }
            FpSpread2.Sheets[0].ColumnCount           = 3;
            FpSpread2.Sheets[0].ColumnHeader.RowCount = 1;
            darkStyle.Font.Name       = "Book Antiqua";
            darkStyle.Font.Bold       = true;
            darkStyle.Font.Size       = FontUnit.Medium;
            darkStyle.HorizontalAlign = HorizontalAlign.Center;
            darkStyle.BackColor       = ColorTranslator.FromHtml("#0CA6CA");
            darkStyle.ForeColor       = Color.Black;
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle = darkStyle;
            FpSpread2.Sheets[0].AutoPostBack                  = false;
            FpSpread2.Sheets[0].Columns[0].Locked             = true;
            FpSpread2.Sheets[0].Columns[1].Locked             = true;
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 1].Text = "University Name";

            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Select";
            FpSpread2.Sheets[0].Columns[0].HorizontalAlign    = HorizontalAlign.Center;
            FpSpread2.Sheets[0].Columns[2].HorizontalAlign    = HorizontalAlign.Center;
            FpSpread2.Sheets[0].Columns[0].Locked             = true;
            FpSpread2.Sheets[0].Columns[1].Locked             = true;
            FpSpread2.Sheets[0].Columns[0].Width = 40;
            FpSpread2.Sheets[0].Columns[1].Width = 220;
            FpSpread2.Sheets[0].Columns[2].Width = 50;
            //FpSpread1.Sheets[0].Columns[2].Locked = true;

            //FpSpread2.Sheets[0].Columns[2].Locked = true;

            //bindsubjectpdf();
            FpSpread2.Sheets[0].RowCount = 0;

            FpSpread2.SaveChanges();
            count = 0;

            collegecode = ddlcollege.SelectedValue.ToString();
            for (int i = 0; i < chklstdegree.Items.Count; i++)
            {
                if (chklstdegree.Items[i].Selected == true)
                {
                    if (course_id == "")
                    {
                        course_id = "" + chklstdegree.Items[i].Value.ToString() + "";
                    }
                    else
                    {
                        course_id = course_id + "," + "" + chklstdegree.Items[i].Value.ToString() + "";
                    }
                }
            }

            if (group_user.Contains(';'))
            {
                string[] group_semi = group_user.Split(';');
                group_user = group_semi[0].ToString();
            }
            ds2.Dispose();
            ds2.Reset();
            if (course_id.Trim() != "")
            {
                if (course_id.ToString().Trim() != "")
                {
                    //if (singleuser == "True")
                    //{
                    //    ds2.Dispose();
                    //    ds2.Reset();
                    //    string strquery = "select distinct department.dept_name,department.dept_code from degree,department,course,deptprivilages where course.course_id=degree.course_id and department.dept_code=degree.dept_code and course.college_code = degree.college_code and department.college_code = degree.college_code and degree.course_id in(" + course_id + ") and degree.college_code=" + collegecode + "  and deptprivilages.Degree_code=degree.Degree_code and user_code=" + usercode + " ";
                    //    ds2 = da.select_method_wo_parameter(strquery, "Text");
                    //}
                    //else
                    //{
                    //    ds2.Dispose();
                    //    ds2.Reset();
                    //    string strquery1 = "select distinct department.dept_name,department.dept_code from degree,department,course,deptprivilages where course.course_id=degree.course_id and department.dept_code=degree.dept_code and course.college_code = degree.college_code and department.college_code = degree.college_code and degree.course_id in(" + course_id + ") and degree.college_code=" + collegecode + "  and deptprivilages.Degree_code=degree.Degree_code and group_code=" + group_user + "";
                    //    ds2 = da.select_method_wo_parameter(strquery1, "Text");
                    //}


                    ds2.Dispose();
                    ds2.Reset();
                    string strquery1 = "select distinct TextCode as dept_code,TextVal as dept_name from textvaltable where TextCriteria = 'cours' and college_code = '" + Session["collegecode"].ToString() + "'";
                    ds2 = da.select_method_wo_parameter(strquery1, "Text");
                }
                if (ds2.Tables[0].Rows.Count > 0)
                {
                    FpSpread2.Sheets[0].Rows.Count++;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = chkboxsel_all;
                    chkboxsel_all.AutoPostBack = true;
                    ds.Clear();
                    string slq = " select UnivText_code,(select TextVal from textvaltable d where tbl_UnivGrouping.UnivText_code=d.TextCode)dept_name,(select textval from textvaltable t where tbl_UnivGrouping.Univ_code=t.TextCode)as grp  from tbl_UnivGrouping where type='" + ddltype.SelectedItem.Text.ToString() + "' and college_code='" + ddlcollege.SelectedItem.Value.ToString() + "' " + groupnn + "";

                    ds  = da.select_method_wo_parameter(slq, "Text");
                    slq = "";
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        FpSpread2.Sheets[0].Rows.Count++;

                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(i + 1);
                        // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Text   = Convert.ToString(ds.Tables[0].Rows[i]["dept_name"].ToString());
                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Tag    = Convert.ToString(ds.Tables[0].Rows[i]["UnivText_code"].ToString());;
                        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;

                        if (slq == "")
                        {
                            slq = ds.Tables[0].Rows[i][0].ToString();
                        }
                        else
                        {
                            slq = slq + "','" + ds.Tables[0].Rows[i][0].ToString();
                        }
                    }
                    //if (ds.Tables[0].Rows.Count>0)
                    //{
                    //    ddltitlename.SelectedIndex = ddltitlename.Items.IndexOf(ddltitlename.Items.FindByValue(ds.Tables[0].Rows[0][2].ToString()));
                    //}
                    FpSpread2.Sheets[0].PageSize = FpSpread2.Sheets[0].RowCount;


                    FpSpread2.SaveChanges();
                    if (slq.Trim() != "")
                    {
                        slq = "Dept_code not in ('" + slq + "')";
                        ds2.Tables[0].DefaultView.RowFilter = slq;
                        dv = ds2.Tables[0].DefaultView;
                    }
                    else
                    {
                        dv = ds2.Tables[0].DefaultView;
                    }
                    movdiv.Visible = true;
                    FpSpread1.Sheets[0].RowHeader.Visible = false;

                    FpSpread1.CommandBar.Visible = false;

                    FpSpread1.Sheets[0].ColumnCount           = 3;
                    FpSpread1.Sheets[0].ColumnHeader.RowCount = 1;
                    darkStyle.Font.Name       = "Book Antiqua";
                    darkStyle.Font.Bold       = true;
                    darkStyle.Font.Size       = FontUnit.Medium;
                    darkStyle.HorizontalAlign = HorizontalAlign.Center;
                    darkStyle.BackColor       = ColorTranslator.FromHtml("#0CA6CA");
                    darkStyle.ForeColor       = Color.Black;
                    FpSpread1.Sheets[0].ColumnHeader.DefaultStyle = darkStyle;
                    FpSpread1.Sheets[0].AutoPostBack                  = false;
                    FpSpread1.Sheets[0].Columns[0].Locked             = true;
                    FpSpread1.Sheets[0].Columns[1].Locked             = true;
                    FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No";
                    FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Text = "University Name";

                    FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Select";
                    FpSpread1.Sheets[0].Columns[0].HorizontalAlign    = HorizontalAlign.Center;
                    FpSpread1.Sheets[0].Columns[2].HorizontalAlign    = HorizontalAlign.Center;
                    FpSpread1.Sheets[0].Columns[0].Locked             = true;
                    FpSpread1.Sheets[0].Columns[1].Locked             = true;
                    FpSpread1.Sheets[0].Columns[0].Width = 40;
                    FpSpread1.Sheets[0].Columns[1].Width = 220;
                    FpSpread1.Sheets[0].Columns[2].Width = 50;
                    //FpSpread1.Sheets[0].Columns[2].Locked = true;

                    //bindsubjectpdf();
                    FpSpread1.Sheets[0].RowCount = 0;

                    FpSpread1.SaveChanges();
                    if (dv.Count > 0)
                    {
                        FpSpread1.Sheets[0].Rows.Count++;
                        FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].CellType = chkboxsel_all;
                        chkboxsel_all.AutoPostBack = true;
                    }
                    for (int ii = 0; ii < dv.Count; ii++)
                    {
                        FpSpread1.Sheets[0].Rows.Count++;

                        FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(ii + 1);
                        // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
                        FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 1].Text   = Convert.ToString(dv[ii]["dept_name"].ToString());
                        FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 1].Tag    = Convert.ToString(dv[ii]["dept_code"].ToString());;
                        FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;

                        // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].Text = ds.Tables[0].Rows[ii]["Reg_No"].ToString();
                    }
                    //int rowheigth = FpSpread1.Sheets[0].Rows[FpSpread1.Sheets[0].RowCount - 1].Height;
                    //rowheigth = rowheigth * FpSpread1.Sheets[0].Rows.Count;
                    //FpSpread1.Height = rowheigth + 100;
                    FpSpread1.Sheets[0].PageSize = FpSpread1.Sheets[0].RowCount;
                    FpSpread1.SaveChanges();

                    FpSpread1.Visible = true;
                }
            }
            else
            {
            }
        }


        catch
        {
        }
    }
    protected void Btnmoveright_OnClick(object sender, EventArgs e)
    {
        //   lblgrperr.Visible = false;
        //   FpSpread1.SaveChanges();
        ////   FpSpread2.Sheets[0].RowCount = 0;
        //   FpSpread2.SaveChanges();
        //   for (int iy = 0; iy < FpSpread1.Sheets[0].RowCount; iy++)
        //   {
        //       if (Convert.ToInt32(FpSpread1.Sheets[0].Cells[iy, 2].Value) == 1)
        //       {
        //           FpSpread2.Sheets[0].Rows.Count++;

        //           FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(FpSpread2.Sheets[0].Rows.Count);
        //           // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
        //           FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Text = FpSpread1.Sheets[0].Cells[iy, 1].Text.ToString(); ;
        //           FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Tag = Convert.ToString(FpSpread1.Sheets[0].Cells[iy, 1].Tag.ToString());
        //           FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;
        //       }

        //   }
        //   //int rowheigth = FpSpread2.Sheets[0].Rows[FpSpread2.Sheets[0].RowCount - 1].Height;
        //   //rowheigth = rowheigth * FpSpread2.Sheets[0].Rows.Count;
        // //  FpSpread2.Height = rowheigth + 100;
        //   FpSpread2.Sheets[0].PageSize = FpSpread2.Sheets[0].RowCount;
        //   FpSpread2.SaveChanges();

        //   FpSpread2.Visible = true;
        //   if (FpSpread2.Sheets[0].RowCount == 0)
        //   {
        //       lblgrperr.Text = "Please Select Atleast One Department";
        //       lblgrperr.Visible = true;
        //   }
        //   else
        //   {
        //       lblgrperr.Visible = false;
        //   }

        lblgrperr.Visible = false;
        FpSpread1.SaveChanges();
        int       cccheck = 0;
        DataTable dt      = new DataTable();

        dt.Columns.Add("Sno");
        dt.Columns.Add("Deptname");
        dt.Columns.Add("deptcode");
        dt.Rows.Clear();
        DataTable dt1 = new DataTable();

        dt1.Columns.Add("Sno");
        dt1.Columns.Add("Deptname");
        dt1.Columns.Add("deptcode");
        dt1.Rows.Clear();

        for (int iy = 0; iy < FpSpread1.Sheets[0].RowCount; iy++)
        {
            if (Convert.ToInt32(FpSpread1.Sheets[0].Cells[iy, 2].Value) == 0)
            {
                dt.Rows.Add(Convert.ToString(dt.Rows.Count + 1), FpSpread1.Sheets[0].Cells[iy, 1].Text.ToString(), FpSpread1.Sheets[0].Cells[iy, 1].Tag.ToString());
            }
            else
            {
                dt1.Rows.Add(Convert.ToString(dt.Rows.Count + 1), FpSpread1.Sheets[0].Cells[iy, 1].Text.ToString(), FpSpread1.Sheets[0].Cells[iy, 1].Tag.ToString());
                cccheck++;
            }
            //  FpSpread2.Sheets[0].Cells[iy, 2].Value = 0;
        }
        if (dt.Rows.Count > 0)
        {
            //FpSpread2.DataSource = dt;
            //FpSpread2.DataBind();
            FpSpread1.Sheets[0].Rows.Count = 0;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                FpSpread1.Sheets[0].Rows.Count++;

                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(dt.Rows[i][0].ToString());
                // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 1].Text   = Convert.ToString(dt.Rows[i][1].ToString());
                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].Rows.Count - 1, 1].Tag    = Convert.ToString(dt.Rows[i][2].ToString());;
                FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;
            }
        }
        else
        {
            FpSpread1.Sheets[0].RowCount = 0;
            FpSpread1.SaveChanges();
        }
        if (dt1.Rows.Count > 0)
        {
            //FpSpread2.DataSource = dt;
            //FpSpread2.DataBind();

            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                FpSpread2.Sheets[0].Rows.Count++;

                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 0].Text = Convert.ToString(FpSpread2.Sheets[0].Rows.Count);
                // FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 2].CellType = txtceltype;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Text   = Convert.ToString(dt1.Rows[i][1].ToString());
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].Rows.Count - 1, 1].Tag    = Convert.ToString(dt1.Rows[i][2].ToString());;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType = chkboxcol;
            }
            FpSpread2.Sheets[0].PageSize = FpSpread2.Sheets[0].RowCount;

            FpSpread2.SaveChanges();
        }

        FpSpread1.Sheets[0].PageSize = FpSpread1.Sheets[0].RowCount;
        FpSpread1.SaveChanges();

        FpSpread1.Visible = true;
        if (cccheck == 0)
        {
            lblgrperr.Text    = "Please Select Atleast One Department";
            lblgrperr.Visible = true;
        }
        else
        {
            lblgrperr.Visible = false;
        }
    }
示例#17
0
    public void loadfp()
    {
        #region load header

        FpSpread2.Sheets[0].RowCount     = 0;
        FpSpread2.Sheets[0].AutoPostBack = false;
        FarPoint.Web.Spread.TextCellType  txt  = new FarPoint.Web.Spread.TextCellType();
        FarPoint.Web.Spread.ImageCellType imgt = new FarPoint.Web.Spread.ImageCellType();
        ArrayList header = new ArrayList();

        header.Add("S.No.");
        header.Add("Edu. Level");
        header.Add("Batch Year");
        header.Add("Degree");
        header.Add("Branch");
        header.Add("Select");
        header.Add("Is Final Year Show Result Only All Pass?");

        // FpSpread2.Visible = false;
        FpSpread2.CommandBar.Visible = false;
        FpSpread2.RowHeader.Visible  = false;

        FpSpread2.Sheets[0].ColumnCount = header.Count;

        for (int ii = 0; ii < header.Count; ii++)
        {
            //   FpSpread2.Sheets[0].Columns[ii].Width = 120;
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, ii].Text = header[ii].ToString();
            if (ii < header.Count - 2)
            {
                FpSpread2.Sheets[0].Columns[ii].Locked = true;
            }
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, ii].CellType = txt;
        }

        string qryEduLevel = string.Empty;
        string eduLevel    = string.Empty;
        foreach (ListItem li in cblEduLevel.Items)
        {
            if (li.Selected)
            {
                if (string.IsNullOrEmpty(eduLevel))
                {
                    eduLevel = "'" + li.Text + "'";
                }
                else
                {
                    eduLevel += ",'" + li.Text + "'";
                }
            }
        }
        if (!string.IsNullOrEmpty(eduLevel))
        {
            qryEduLevel = " and c.edu_level in (" + eduLevel + ")";
        }

        string qryBatchYear = string.Empty;
        string BatchYear    = string.Empty;
        foreach (ListItem li in chklsbatch.Items)
        {
            if (li.Selected)
            {
                if (string.IsNullOrEmpty(BatchYear))
                {
                    BatchYear = "'" + li.Value + "'";
                }
                else
                {
                    BatchYear += ",'" + li.Value + "'";
                }
            }
        }
        if (!string.IsNullOrEmpty(BatchYear))
        {
            qryBatchYear = " and p.batch_year in (" + BatchYear + ")";
        }

        string qryDegreeCode = string.Empty;
        string DegreeCode    = string.Empty;
        foreach (ListItem li in chklstbranch.Items)
        {
            if (li.Selected)
            {
                if (string.IsNullOrEmpty(DegreeCode))
                {
                    DegreeCode = "'" + li.Value + "'";
                }
                else
                {
                    DegreeCode += ",'" + li.Value + "'";
                }
            }
        }
        if (!string.IsNullOrEmpty(DegreeCode))
        {
            qryDegreeCode = " and p.degree_code in (" + DegreeCode + ")";
        }

        FpSpread2.Sheets[0].Columns[4].Width           = 250;
        FpSpread2.Sheets[0].Columns[4].HorizontalAlign = HorizontalAlign.Left;

        #endregion

        #region loaddata

        FarPoint.Web.Spread.CheckBoxCellType chkcell = new FarPoint.Web.Spread.CheckBoxCellType();

        FpSpread2.Sheets[0].RowCount = 0;
        FarPoint.Web.Spread.CheckBoxCellType chkcell1 = new FarPoint.Web.Spread.CheckBoxCellType();
        FpSpread2.Sheets[0].RowCount = FpSpread2.Sheets[0].RowCount + 1;
        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 5].CellType        = chkcell1;
        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 5].HorizontalAlign = HorizontalAlign.Center;
        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 6].CellType        = chkcell1;
        FpSpread2.Sheets[0].Columns[6].Width = 240;
        FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 6].HorizontalAlign = HorizontalAlign.Center;
        FpSpread2.Sheets[0].FrozenRowCount = 1;
        chkcell1.AutoPostBack = true;

        FpSpread2.Sheets[0].AutoPostBack = false;
        sql = "select publishid,c.Edu_Level,p.batch_year,c.Course_Name,dd.Dept_Name,p.isFinalYear from publishresult p,Degree d,Department dd,Course c where p.degree_code=d.Degree_Code and d.Dept_Code=dd.Dept_Code and c.Course_Id=d.Course_Id  and d.college_code=c.college_code and p.exam_month='" + ddlMonth.SelectedItem.Value.ToString() + "'  and exam_year='" + ddlYear.SelectedItem.Text.ToString() + "'  and d.college_code='" + Session["collegecode"].ToString() + "' " + qryEduLevel + qryDegreeCode + qryBatchYear + "  order by Edu_Level desc,p.batch_year,c.Course_Name,dd.Dept_Name";

        ds.Clear();
        ds = da.select_method_wo_parameter(sql, "Text");

        if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            int sno = 0;
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                sno++;
                FpSpread2.Sheets[0].RowCount = FpSpread2.Sheets[0].RowCount + 1;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].Text            = sno + "";
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].CellType        = txt;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].Text            = ds.Tables[0].Rows[i]["Edu_Level"].ToString();
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].CellType        = txt;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].Text            = ds.Tables[0].Rows[i]["batch_year"].ToString();;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Text            = ds.Tables[0].Rows[i]["Course_Name"].ToString();
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 4].Text            = ds.Tables[0].Rows[i]["Dept_Name"].ToString();
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 4].Tag             = ds.Tables[0].Rows[i]["publishid"].ToString();
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 5].CellType        = chkcell;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].HorizontalAlign = HorizontalAlign.Center;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 5].HorizontalAlign = HorizontalAlign.Center;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 6].CellType        = chkcell;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 6].HorizontalAlign = HorizontalAlign.Center;
                FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 6].Value           = 0;
                if (Convert.ToString(ds.Tables[0].Rows[i]["isFinalYear"]).Trim().ToLower() == "1" || Convert.ToString(ds.Tables[0].Rows[i]["isFinalYear"]).Trim().ToLower() == "true")
                {
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 6].Value = 1;
                }
            }

            FpSpread2.SaveChanges();
            FpSpread2.Width = 930;
            //  FpSpread2.Visible = true;
            string totalrows = FpSpread2.Sheets[0].RowCount.ToString();
            FpSpread2.Sheets[0].PageSize = (Convert.ToInt32(totalrows) * 20) + 40;
            FpSpread2.Height             = (Convert.ToInt32(totalrows) * 24) + 60;
            showdata.Visible             = true;
            FpSpread2.Sheets[0].SetColumnMerge(1, FarPoint.Web.Spread.Model.MergePolicy.Always);
            errmsg.Text    = string.Empty;
            errmsg.Visible = true;
        }
        else
        {
            errmsg.Text      = "No Publish result details Found on this " + ddlMonth.SelectedItem.Text.ToString() + " " + ddlYear.SelectedItem.Text.ToString() + "";
            errmsg.Visible   = true;
            showdata.Visible = false;
        }

        #endregion
    }
示例#18
0
    protected void Buttongo_Click(object sender, EventArgs e)
    {
        try
        {
            ss2 = "";
            p   = "";
            FpSpread2.Visible                    = false;//btnreset.Visible = false;
            FpSpread2.CommandBar.Visible         = false;
            FpSpread2.Sheets[0].RowCount         = 0;
            FpSpread2.Sheets[0].ColumnCount      = 4;
            FpSpread2.Sheets[0].Columns[0].Width = 100;
            FpSpread2.Sheets[0].Columns[1].Width = 100;
            FpSpread2.Sheets[0].Columns[2].Width = 100;
            FpSpread2.Sheets[0].Columns[3].Width = 100;
            // FpSpread2.Sheets[0].Columns[4].Width = 90;

            //FpSpread2.Sheets[0].Columns[0].Locked = true;
            //FpSpread2.Sheets[0].Columns[1].Locked = true;
            //FpSpread2.Sheets[0].Columns[2].Locked = true;
            //FpSpread2.Sheets[0].Columns[4].Locked = true;



            FpSpread2.Sheets[0].RowHeader.Visible      = false;
            FpSpread2.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Name = "Book Antiqua";
            FpSpread2.Sheets[0].ColumnHeader.DefaultStyle.Font.Bold = true;
            FpSpread2.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
            FpSpread2.Sheets[0].DefaultStyle.Font.Name = "Book Antiqua";
            FpSpread2.Sheets[0].SheetCorner.RowCount   = 1;



            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 0].Text = "From Point";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 1].Text = "To Point";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Credit Points";
            FpSpread2.Sheets[0].ColumnHeader.Cells[0, 3].Text = "Grade";
            // FpSpread2.Sheets[0].ColumnHeader.Cells[0, 4].Text = "Priority";

            FarPoint.Web.Spread.DoubleCellType intgrcell = new FarPoint.Web.Spread.DoubleCellType();
            intgrcell.FormatString = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals.ToString();
            intgrcell.MaximumValue = Convert.ToInt32(100);
            intgrcell.MinimumValue = 0;
            intgrcell.ErrorMessage = "Enter valid Mark";

            FarPoint.Web.Spread.DoubleCellType intgrcell_cp = new FarPoint.Web.Spread.DoubleCellType();
            intgrcell_cp.FormatString = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals.ToString();
            intgrcell_cp.MaximumValue = Convert.ToInt32(10);
            intgrcell_cp.MinimumValue = 0;
            intgrcell_cp.ErrorMessage = "Enter valid Credit Points";

            FarPoint.Web.Spread.TextCellType txt = new FarPoint.Web.Spread.TextCellType();

            FpSpread2.Sheets[0].Columns[0].CellType = intgrcell;
            FpSpread2.Sheets[0].Columns[1].CellType = intgrcell;
            FpSpread2.Sheets[0].Columns[2].CellType = intgrcell_cp;
            FpSpread2.Sheets[0].Columns[3].CellType = txt;



            FpSpread2.Sheets[0].AutoPostBack = false;


            string batchyear = ddlbatch.SelectedValue.ToString();

            string degree = ddldegree.SelectedItem.Value.ToString();

            string depart_code = ddlbranch.SelectedValue.ToString();

            string studinfo = "";

            studinfo = "select * from Grade_Master where   College_Code='" + Session["collegecode"].ToString() + "' and  batch_year='" + ddlbatch.SelectedItem.Text.ToString() + "'  and degree_code='" + depart_code + "'";

            DataSet dsstudinfo = da.select_method_wo_parameter(studinfo, "Text");
            if (dsstudinfo.Tables[0].Rows.Count > 0)
            {
                btnsave.Visible = true;

                int sno = 0;
                for (int studcount = 0; studcount < dsstudinfo.Tables[0].Rows.Count; studcount++)
                {
                    FpSpread2.Visible = true;
                    sno++;

                    FpSpread2.Sheets[0].RowCount = FpSpread2.Sheets[0].RowCount + 1;
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 0].Text = dsstudinfo.Tables[0].Rows[studcount]["Frange"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 1].Text = dsstudinfo.Tables[0].Rows[studcount]["Trange"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 2].Text = dsstudinfo.Tables[0].Rows[studcount]["Credit_Points"].ToString();
                    FpSpread2.Sheets[0].Cells[FpSpread2.Sheets[0].RowCount - 1, 3].Text = dsstudinfo.Tables[0].Rows[studcount]["Mark_Grade"].ToString();;
                }
            }
            else
            {
                //clear();
                //lblerror.Text = "No Records Found";
                //lblerror.Visible = true;
                FpSpread2.Visible = true;
                btnsave.Visible   = true;
                Button1.Visible   = true;
                showdata.Visible  = true;
            }
            string totalrows = FpSpread2.Sheets[0].RowCount.ToString();
            FpSpread2.Sheets[0].PageSize = (Convert.ToInt32(totalrows) * 20) + 40;
            FpSpread2.Height             = 350;
            FpSpread2.SaveChanges();
            FpSpread2.Visible = true;
            btnsave.Visible   = true;
            Button1.Visible   = true;
            showdata.Visible  = true;
        }
        catch (Exception ex)
        {
            lblerror.Text    = ex.ToString();
            lblerror.Visible = true;
        }
    }