protected void addrowStage(object sender, EventArgs e) { if (ddlcertificate.Items.Count > 1) { lblerror.Visible = false; FpSpreadstage.Sheets[0].RowCount = FpSpreadstage.Sheets[0].RowCount + 1; string sqlcmd = string.Empty; //sqlcmd = "select distinct textcode,textval from textvaltable where textcriteria in ('Sdis','dis') "; //modified by prabha textcriteria='Sdis' sqlcmd = "select * from District_Stage";//Modified by rajasekar on 11/05/2018 DataSet dnew = new DataSet(); dnew = dset.select_method_wo_parameter(sqlcmd, "text"); FarPoint.Web.Spread.ComboBoxCellType cmbcol = new FarPoint.Web.Spread.ComboBoxCellType(); cmbcol.ShowButton = true; cmbcol.UseValue = true; cmbcol.DataSource = dnew; //cmbcol.DataTextField = "textval"; //cmbcol.DataValueField = "textcode"; cmbcol.DataTextField = "District_Name"; //Modified by rajasekar on 11/05/2018 cmbcol.DataValueField = "District_Code"; //Modified by rajasekar on 11/05/2018 FpSpreadstage.Sheets[0].Columns[1].CellType = cmbcol; FpSpreadstage.Sheets[0].Cells[0, 4].Value = 0; Buttondelete.Enabled = false; btnsave.Enabled = true; FpSpreadstage.Sheets[0].PageSize = FpSpreadstage.Sheets[0].RowCount; FpSpreadstage.SaveChanges(); } else { lblerror.Visible = false; lblerror.Text = "Enter the District Name"; } }
public void loadstage() { FarPoint.Web.Spread.TextCellType tb = new FarPoint.Web.Spread.TextCellType(); //FpSpreadstage.Sheets[0].AutoPostBack = true; //FpSpreadstage.ActiveSheetView.SheetCorner.Cells[0, 0].Text = "S.No"; //FpSpreadstage.ActiveSheetView.SheetCorner.DefaultStyle.Font.Bold = true; FpSpreadstage.ActiveSheetView.DefaultRowHeight = 25; FpSpreadstage.ActiveSheetView.Rows.Default.Font.Name = "MS Sans Serif"; FpSpreadstage.ActiveSheetView.Rows.Default.Font.Size = FontUnit.Small; FpSpreadstage.ActiveSheetView.Rows.Default.Font.Bold = false; FpSpreadstage.ActiveSheetView.Columns.Default.Font.Bold = false; FpSpreadstage.Sheets[0].RowHeader.Visible = false; FpSpreadstage.ActiveSheetView.Columns.Default.Font.Name = "MS Sans Serif"; FpSpreadstage.ActiveSheetView.Columns.Default.Font.Size = FontUnit.Small; FpSpreadstage.ActiveSheetView.ColumnHeader.DefaultStyle.Font.Bold = true; FpSpreadstage.ActiveSheetView.ColumnHeader.DefaultStyle.Font.Name = "MS Sans Serif"; FpSpreadstage.ActiveSheetView.ColumnHeader.DefaultStyle.Font.Size = FontUnit.Small; FpSpreadstage.VerticalScrollBarPolicy = FarPoint.Web.Spread.ScrollBarPolicy.AsNeeded; FpSpreadstage.HorizontalScrollBarPolicy = FarPoint.Web.Spread.ScrollBarPolicy.AsNeeded; FarPoint.Web.Spread.ButtonCellType btnmodify = new FarPoint.Web.Spread.ButtonCellType(); FarPoint.Web.Spread.CheckBoxCellType cbxd = new FarPoint.Web.Spread.CheckBoxCellType(); FarPoint.Web.Spread.ComboBoxCellType cf = new FarPoint.Web.Spread.ComboBoxCellType(); cf.AutoPostBack = true; cbxd.AutoPostBack = true; btnmodify.Text = "Remove"; FpSpreadstage.Sheets[0].RowCount = 0; FpSpreadstage.Sheets[0].ColumnCount = 5; FpSpreadstage.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No"; FpSpreadstage.Sheets[0].ColumnHeader.Cells[0, 1].Text = "District"; FpSpreadstage.Sheets[0].Columns[1].CellType = cf; FpSpreadstage.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Stage Name"; FpSpreadstage.Sheets[0].ColumnHeader.Cells[0, 3].Text = "Address"; FpSpreadstage.Sheets[0].ColumnHeader.Cells[0, 4].Text = "Select"; FpSpreadstage.Sheets[0].Columns[4].CellType = cbxd; //FpSpreadstage.Sheets[0].Columns[2].CellType = btnmodify; FpSpreadstage.Sheets[0].Columns[3].Visible = true; FpSpreadstage.Sheets[0].Columns[0].HorizontalAlign = HorizontalAlign.Center; FpSpreadstage.Sheets[0].Columns[4].HorizontalAlign = HorizontalAlign.Center; //FpSpreadstage.Sheets[0].Columns[2].Font.Bold = true; FpSpreadstage.Sheets[0].Columns[0].Width = 40; FpSpreadstage.Sheets[0].Columns[1].Width = 200; FpSpreadstage.Sheets[0].Columns[2].Width = 350; FpSpreadstage.Sheets[0].Columns[3].Width = 340; FpSpreadstage.Sheets[0].Columns[4].Width = 50; FpSpreadstage.Sheets[0].PageSize = 100; FpSpreadstage.Width = 1000; FpSpreadstage.Height = 391; FpSpreadstage.SaveChanges(); FpSpreadstage.CommandBar.Visible = false; }
public void FpSpread2_UpdateCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)//del { FarPoint.Web.Spread.ButtonCellType btn = new FarPoint.Web.Spread.ButtonCellType(); FarPoint.Web.Spread.DoubleCellType txtserialNo = new FarPoint.Web.Spread.DoubleCellType(); txtserialNo.ErrorMessage = "Allow only numbers"; btn.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton; btn.Text = "Quota Settings"; string clgDetails = string.Empty; string actrow = FpSpread1.Sheets[0].ActiveRow.ToString(); string actcol = FpSpread1.Sheets[0].ActiveColumn.ToString(); if (actrow.Trim() != "" && actcol.Trim() != "") { clgDetails = Convert.ToString(FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), Convert.ToInt32(actcol)].Text); if (clgDetails == "Quota") { btn.Text = "Quota Settings"; FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), 4].CellType = btn; } //else //{ // string[] prefix = new string[2]; // prefix[0] = "Prefix"; // prefix[1] = "Suffix"; // FarPoint.Web.Spread.ComboBoxCellType dropdown2 = new FarPoint.Web.Spread.ComboBoxCellType(prefix, prefix); // FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), 4].CellType = dropdown2; //} if (clgDetails == "Serial No") { string start = FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), 1].Text; string end = FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), 2].Text; int difference = 0, startVal = 0, endVal = 0; int.TryParse(start, out startVal); int.TryParse(end, out endVal); difference = endVal - startVal; double maxValue = Math.Pow(10, difference); FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), 4].CellType = txtserialNo; txtserialNo.MinimumValue = 0; txtserialNo.MaximumValue = maxValue - 1; txtserialNo.ErrorMessage = "Must Enter Between 0 and " + (maxValue - 1); txtserialNo.CssClass = "txtbgColor"; FarPoint.Web.Spread.StyleInfo darkstyle = new FarPoint.Web.Spread.StyleInfo(); darkstyle.BackColor = ColorTranslator.FromHtml("#0BA6CB"); darkstyle.ForeColor = Color.White; } if (checkSchoolSetting() == 0) { if (clgDetails == "College Acr" || clgDetails == "Department Acr" || clgDetails == "College Code" || clgDetails == "Year" || clgDetails == "Batch Year" || clgDetails == "Sem") { string[] prefix = new string[2]; prefix[0] = "Prefix"; prefix[1] = "Suffix"; FarPoint.Web.Spread.ComboBoxCellType dropdown2 = new FarPoint.Web.Spread.ComboBoxCellType(prefix, prefix); FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), 4].CellType = dropdown2; } if (actcol == "4") { if (btn.Text == "Quota Settings") { gridquota_DataBound(); alertpopwindow.Visible = true; } } } else { if (clgDetails == "School Acr" || clgDetails == "Department Acr" || clgDetails == "Class Code" || clgDetails == "Year" || clgDetails == "Batch Year" || clgDetails == "Term") { string[] prefix = new string[2]; prefix[0] = "Prefix"; prefix[1] = "Suffix"; FarPoint.Web.Spread.ComboBoxCellType dropdown2 = new FarPoint.Web.Spread.ComboBoxCellType(prefix, prefix); FpSpread1.Sheets[0].Cells[Convert.ToInt32(actrow), 4].CellType = dropdown2; } if (actcol == "4") { if (btn.Text == "Quota Settings") { gridquota_DataBound(); alertpopwindow.Visible = true; } } } } }
protected void Generate_Click(object sender, EventArgs e) { try { lblerror.Visible = false; DataSet ds = new DataSet(); string clgcode = Session["collegecode"].ToString(); FpSpread1.Sheets[0].RowHeader.Visible = false; FpSpread1.Sheets[0].AutoPostBack = false; FpSpread1.CommandBar.Visible = false; FpSpread1.Sheets[0].RowCount = 0; FpSpread1.Sheets[0].ColumnCount = 0; FpSpread1.Sheets[0].ColumnHeader.RowCount = 1; FpSpread1.Sheets[0].Columns.Count = 5; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Font.Bold = true; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Font.Name = "Book Antiqua"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Columns[0].Width = 100; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Text = "From Digit"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Font.Bold = true; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Font.Name = "Book Antiqua"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Columns[1].Width = 100; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Text = "To Digit"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Font.Bold = true; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Font.Name = "Book Antiqua"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Columns[2].Width = 100; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 3].Text = "Select"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 3].Font.Bold = true; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 3].Font.Name = "Book Antiqua"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 3].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 3].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Columns[3].Width = 100; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 4].Text = "Prefix/Suffix"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 4].Font.Bold = true; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 4].Font.Name = "Book Antiqua"; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 4].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 4].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Columns[4].Width = 130; FarPoint.Web.Spread.StyleInfo darkstyle = new FarPoint.Web.Spread.StyleInfo(); darkstyle.BackColor = ColorTranslator.FromHtml("#0BA6CB"); darkstyle.ForeColor = Color.White; FpSpread1.ActiveSheetView.ColumnHeader.DefaultStyle = darkstyle; int val = 0; Int32.TryParse(txtsize.Text, out val); string[] item = new string[0]; if (val > 0) { for (int v = 0; v <= val; v++) { Array.Resize(ref item, item.Length + 1); item[item.Length - 1] = Convert.ToString(v); } } FarPoint.Web.Spread.ComboBoxCellType dropdown1 = new FarPoint.Web.Spread.ComboBoxCellType(); string query = "select distinct MasterCode,MasterValue from CO_MasterValues where MasterCriteria='ApplicationNumberGeneration' and CollegeCode='" + clgcode + "'"; ds.Clear(); ds = d2.select_method_wo_parameter(query, "Text"); if (ds.Tables[0].Rows.Count > 0) { dropdown1.DataSource = ds; dropdown1.DataTextField = "MasterValue"; dropdown1.DataValueField = "MasterCode"; } dropdown1.AutoPostBack = false; FarPoint.Web.Spread.ButtonCellType btn = new FarPoint.Web.Spread.ButtonCellType(); string[] prefix = new string[2]; prefix[0] = "Prefix"; prefix[1] = "Suffix"; FarPoint.Web.Spread.ComboBoxCellType dropdown = new FarPoint.Web.Spread.ComboBoxCellType(item, item); FarPoint.Web.Spread.ComboBoxCellType dropdown2 = new FarPoint.Web.Spread.ComboBoxCellType(prefix, prefix); FarPoint.Web.Spread.DoubleCellType txtserialNo = new FarPoint.Web.Spread.DoubleCellType(); btn.CssClass = "textbox btn"; btn.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton; btn.Text = "+"; DataSet CodeGenDS = d2.select_method_wo_parameter(" select NumberType,NumberLength,ag.collegeCode,FRange,TRange,DifferentRange,HeaderCode, Case when convert(varchar(max), startNo)!=0 then convert(varchar(max),startNo) else (case when PrefixOrSufix=1 then 'Prefix' when PrefixOrSufix=2 then 'Suffix' end) end as PrefixOrSufix,GenerationNumber,NumberSize,upper(MasterValue) as type,startNo from AdmissionNoGeneration ag,CO_MasterValues m where ag.collegecode='" + Convert.ToString(ddlclg.SelectedItem.Value) + "' and ag.headercode=m.MasterCode and MasterCriteria='ApplicationNumberGeneration' order by frange,trange ", "text");//ag.collegecode=m.collegecode and string Frange = string.Empty; string Trange = string.Empty; string HeaderCode = string.Empty; string PrefixOrSufix = string.Empty; string NumberSize = string.Empty; string type = string.Empty; int rangeDiff = 0; int StartNo = 0; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { FpSpread1.Sheets[0].RowCount++; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Text = Convert.ToString(FpSpread1.Sheets[0].RowCount); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].CellType = dropdown; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].CellType = dropdown; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].HorizontalAlign = HorizontalAlign.Center; dropdown1.ShowButton = true; dropdown1.AutoPostBack = true; dropdown1.UseValue = true; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 3].CellType = dropdown1; FpSpread1.Sheets[0].Columns[3].CellType = dropdown1; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 3].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 4].CellType = dropdown2; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 4].HorizontalAlign = HorizontalAlign.Center; if (CodeGenDS.Tables != null)//24.01.18 barath { if (i < CodeGenDS.Tables[0].Rows.Count) { if (CodeGenDS.Tables[0].Rows.Count > 0) { Frange = Convert.ToString(CodeGenDS.Tables[0].Rows[i]["FRange"]); Trange = Convert.ToString(CodeGenDS.Tables[0].Rows[i]["TRange"]); HeaderCode = Convert.ToString(CodeGenDS.Tables[0].Rows[i]["HeaderCode"]); PrefixOrSufix = Convert.ToString(CodeGenDS.Tables[0].Rows[i]["PrefixOrSufix"]); int.TryParse(Convert.ToString(CodeGenDS.Tables[0].Rows[i]["DifferentRange"]), out rangeDiff); int.TryParse(Convert.ToString(CodeGenDS.Tables[0].Rows[i]["startNo"]), out StartNo); NumberSize = Convert.ToString(CodeGenDS.Tables[0].Rows[i]["GenerationNumber"]); type = Convert.ToString(CodeGenDS.Tables[0].Rows[i]["type"]); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Text = Frange; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].Text = Trange; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 3].Text = HeaderCode; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 4].Text = PrefixOrSufix; if (type == "QUOTA") { btn.Text = "Quota Settings"; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 4].CellType = btn; } else if (type == "SERIAL NO") { FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 4].CellType = txtserialNo; //string sd = generateApplicationNumber(StartNo, rangeDiff); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 4].Text = PrefixOrSufix; } } } } FpSpread1.SaveChanges(); } FpSpread1.Sheets[0].PageSize = FpSpread1.Sheets[0].RowCount; FpSpread1.SaveChanges(); FpSpread1.Height = 270; FpSpread1.Width = 568; FpSpread1.Visible = true; btnSave.Visible = true; } catch (Exception ex) { } }
protected void btnGo_Click(object sender, EventArgs e) { lblerror.Visible = false; Fpstudents.Visible = false; string batch = ddlBatch.SelectedValue.ToString(); string degree_code = ddlBranch.SelectedValue.ToString(); string sem = ddlSem.SelectedValue; string subjectno = ddlSubject.SelectedValue.ToString(); string examdate = ""; string examcode = ""; string examdate1 = txtExamDate.Text; string datechangenew = ""; string datechange = ""; if (txtExamDate.Text != "") { string[] splitdate = examdate1.Split(new Char[] { '/' }); string reqdate = splitdate[0].ToString(); string reqmonth = splitdate[1].ToString(); string reqyear = splitdate[2].ToString(); datechange = reqmonth + "-" + reqdate + "-" + reqyear; datechangenew = reqdate + "-" + reqmonth + "-" + reqyear; } if (batch != "" && degree_code != "" && sem != "" && subjectno != "") { string examdatequery = "select convert(varchar(10),exam_date,105) as exam_date,ex.exam_code from exmtt ex,exmtt_det ed where ex.exam_code=ed.exam_code and ex.degree_code=" + degree_code + " and ex.batchto=" + batch + " and ex.semester=" + sem + " and ed.subject_no=" + subjectno + ""; SqlDataAdapter daexamdatequery = new SqlDataAdapter(examdatequery, con5); DataSet dsexamdatequery = new DataSet(); con5.Close(); con5.Open(); daexamdatequery.Fill(dsexamdatequery); if (dsexamdatequery.Tables[0].Rows.Count > 0) { examdate = Convert.ToString(dsexamdatequery.Tables[0].Rows[0]["exam_date"]); examcode = Convert.ToString(dsexamdatequery.Tables[0].Rows[0]["exam_code"]); } if (examdate != "") { if (txBatch.Text != "") { if (txtExamDate.Text != "") { Connection(); int n = Convert.ToInt16(txBatch.Text.ToString()); name = new string[n + 1]; int mm = 0; for (int j = 1; j <= n; j++) { name[j] = ("B" + j); name[0] = " "; } string[] strcomo = new string[] { " " }; cb = new FarPoint.Web.Spread.ComboBoxCellType(name); cb.AutoPostBack = true; Hashtable ht = new Hashtable(); ht.Clear(); DAccess2 da = new DAccess2(); DataSet ds = new DataSet(); if (ddlSem.SelectedValue.ToString() != "" && ddlBranch.SelectedValue.ToString() != "" && ddlSection.SelectedItem.Text.ToString() != "" && ddlBatch.SelectedItem.Text.ToString() != "" && ddlSubject.SelectedValue.ToString() != "") { ht.Add("Semester", ddlSem.SelectedItem.Text.ToString()); ht.Add("CollegeCode", Session["collegecode"].ToString()); ht.Add("DegreeCode", ddlBranch.SelectedValue.ToString()); ht.Add("Sections", ddlSection.SelectedItem.Text.ToString()); ht.Add("BatchYear", ddlBatch.SelectedItem.Text.ToString()); ht.Add("SubjectNo", ddlSubject.SelectedValue.ToString()); ds = da.select_method("ProcBatchAllocationRegNoDetails", ht, "sp"); Fpstudents.Sheets[0].RowCount = 0; Fpstudents.Sheets[0].RowCount = ds.Tables[0].Rows.Count + 1; Fpstudents.Sheets[0].PageSize = ds.Tables[0].Rows.Count + 1 * 20; Fpstudents.Sheets[0].SpanModel.Add(0, 0, 1, 5); FarPoint.Web.Spread.CheckBoxCellType chkcell1 = new FarPoint.Web.Spread.CheckBoxCellType(); Fpstudents.Sheets[0].Cells[0, 5].CellType = chkcell1; Fpstudents.Sheets[0].Cells[0, 5].HorizontalAlign = HorizontalAlign.Center; Fpstudents.Sheets[0].FrozenRowCount = 1; chkcell1.AutoPostBack = true; if (ds.Tables[0].Rows.Count > 0) { btnsave.Visible = true; Fpstudents.Visible = true; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string batch1 = ""; if (txtExamDate.Text != "") { string selectbatch = "select batch from batch_allocation_practical where batch_year=" + ddlBatch.SelectedItem.Text.ToString() + " and degree_code=" + ddlBranch.SelectedValue.ToString() + " and semester=" + ddlSem.SelectedValue.ToString() + " and exam_code=" + examcode + " and subject_no=" + ddlSubject.SelectedValue.ToString() + " and roll_no='" + ds.Tables[0].Rows[i]["RollNo"].ToString() + "' and subject_no=" + subjectno + ""; SqlDataAdapter daselectbatch = new SqlDataAdapter(selectbatch, con5); DataSet dsselectbatch = new DataSet(); con5.Close(); con5.Open(); daselectbatch.Fill(dsselectbatch); if (dsselectbatch.Tables[0].Rows.Count > 0) { batch1 = dsselectbatch.Tables[0].Rows[0]["batch"].ToString(); } } Fpstudents.Sheets[0].Cells[i + 1, 0].Text = Convert.ToString(i + 1); Fpstudents.Sheets[0].Cells[i + 1, 0].HorizontalAlign = HorizontalAlign.Center; Fpstudents.Sheets[0].Cells[i + 1, 1].Text = ds.Tables[0].Rows[i]["RollNo"].ToString(); Fpstudents.Sheets[0].Cells[i + 1, 1].HorizontalAlign = HorizontalAlign.Center; Fpstudents.Sheets[0].Cells[i + 1, 2].Text = ds.Tables[0].Rows[i]["RegNo"].ToString(); Fpstudents.Sheets[0].Cells[i + 1, 2].HorizontalAlign = HorizontalAlign.Center; Fpstudents.Sheets[0].Cells[i + 1, 3].Text = ds.Tables[0].Rows[i]["StudentName"].ToString(); Fpstudents.Sheets[0].Cells[i + 1, 4].CellType = cb; Fpstudents.Sheets[0].SetText(i + 1, 4, batch1); } } int rowcount = Fpstudents.Sheets[0].RowCount; Fpstudents.Sheets[0].RowCount = rowcount; Fpstudents.Height = rowcount * 20; if (Session["Rollflag"] == "0") { Fpstudents.Width = 560; Fpstudents.Sheets[0].Columns[1].Visible = false; } if (Session["Regflag"] == "0") { Fpstudents.Width = 510; Fpstudents.Sheets[0].Columns[2].Visible = false; if (Session["Rollflag"] == "0") { Fpstudents.Width = 410; } } } } else { btnsave.Visible = false; Fpstudents.Visible = false; lblerror.Visible = true; lblerror.Text = "Exam Date Not Filled"; } } else { btnsave.Visible = false; Fpstudents.Visible = false; lblerror.Visible = true; lblerror.Text = "No of Batches not Filled"; //ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('No of Batches is not Filled')", true); } } else { btnsave.Visible = false; Fpstudents.Visible = false; lblerror.Visible = true; lblerror.Text = "Time Table not created for this Subject"; //ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('Time Table is not created for this Subject')", true); } } }
protected void btnMainGo_Click(object sender, EventArgs e) { FpSpreadstage.Sheets[0].RowCount = 0; string typeall = string.Empty; string veh_all = string.Empty; if (ddlvehicletypeview.Text == "-1") { for (int i = 0; i < ddlvehicletypeview.Items.Count; i++) { if (i > 0) { if (typeall == "") { typeall = ddlvehicletypeview.Items[i].Value.ToString(); } else { typeall = typeall + "','" + ddlvehicletypeview.Items[i].Value.ToString(); } } } } else { typeall = ddlvehicletypeview.Text.ToString(); } if (ddltypeview.Text == "-1") { for (int i = 0; i < ddltypeview.Items.Count; i++) { if (i > 0) { if (veh_all == "") { //modified by srinath 17/2/2014 string getstagename = ddltypeview.Items[i].Text.ToString(); getstagename = getstagename.Replace("'", "''"); veh_all = getstagename; } else { //modified by srinath 17/2/2014 string getstagename = ddltypeview.Items[i].Text.ToString(); getstagename = getstagename.Replace("'", "''"); veh_all = veh_all + "','" + getstagename; } } } } else { veh_all = ddltypeview.Text.ToString(); } int temp = -1; int temptemp = 0; string getdate = ""; getdate = "select * from Stage_Master where District in('" + typeall + "') and Stage_Name in('" + veh_all + "')"; SqlDataAdapter dr = new SqlDataAdapter(getdate, con); DataSet dt = new DataSet(); dr.Fill(dt); if (dt.Tables[0].Rows.Count > 0) { Btnprint.Enabled = true; Buttondelete.Enabled = false; FpSpreadstage.Sheets[0].RowCount = dt.Tables[0].Rows.Count; string sqlcmd = string.Empty; //select distinct textcode,textval from textvaltable where textcriteria in ('Sdis','dis') modified by prabha sqlcmd = "select distinct textcode,textval from textvaltable where textcriteria in ('Sdis','dis')"; DataSet dnew = new DataSet(); dnew = dset.select_method_wo_parameter(sqlcmd, "text"); for (int i2 = 0; i2 < dt.Tables[0].Rows.Count; i2++) { temp++; temptemp = temp + 1; FpSpreadstage.Sheets[0].Cells[i2, 0].Text = Convert.ToInt32(temptemp).ToString(); FpSpreadstage.Sheets[0].Cells[i2, 2].Text = dt.Tables[0].Rows[i2]["Stage_Name"].ToString(); FpSpreadstage.Sheets[0].Cells[i2, 2].Tag = dt.Tables[0].Rows[i2]["Stage_id"].ToString(); FpSpreadstage.Sheets[0].Cells[i2, 3].Text = dt.Tables[0].Rows[i2]["Address"].ToString(); FarPoint.Web.Spread.ComboBoxCellType cmbcol = new FarPoint.Web.Spread.ComboBoxCellType(); cmbcol.ShowButton = true; cmbcol.UseValue = true; cmbcol.DataSource = dnew; cmbcol.DataTextField = "textval"; cmbcol.DataValueField = "textcode"; FpSpreadstage.Sheets[0].Columns[1].CellType = cmbcol; FpSpreadstage.Sheets[0].Cells[i2, 1].Text = Convert.ToString(dt.Tables[0].Rows[i2]["District"]); FpSpreadstage.Sheets[0].Cells[i2, 4].Value = 0; } FpSpreadstage.Sheets[0].PageSize = FpSpreadstage.Sheets[0].RowCount; btnsave.Enabled = true; Buttondelete.Enabled = true; } FpSpreadstage.SaveChanges(); }
public void GetRecord() { int temp = -1; int temptemp = 0; string getdate = ""; getdate = "select * from Stage_Master"; SqlDataAdapter dr = new SqlDataAdapter(getdate, con); DataSet dt = new DataSet(); dr.Fill(dt); if (dt.Tables[0].Rows.Count > 0) { Btnprint.Enabled = true; Buttondelete.Enabled = false; FpSpreadstage.Sheets[0].RowCount = dt.Tables[0].Rows.Count; string sqlcmd = string.Empty; sqlcmd = "select * from District_Stage";//Modified by rajasekar on 11/05/2018 //sqlcmd = "select distinct textcode,textval from textvaltable where textcriteria in ('Sdis','dis')"; //modified by prabha on 21dec2017 DataSet dnew = new DataSet(); dnew = dset.select_method_wo_parameter(sqlcmd, "text"); ddltypeview.Items.Clear(); ddltypeview.Items.Insert(0, new ListItem("All", "-1")); for (int i2 = 0; i2 < dt.Tables[0].Rows.Count; i2++) { temp++; temptemp = temp + 1; FpSpreadstage.Sheets[0].Cells[i2, 0].Text = Convert.ToInt32(temptemp).ToString(); FpSpreadstage.Sheets[0].Cells[i2, 2].Text = dt.Tables[0].Rows[i2]["Stage_Name"].ToString(); FpSpreadstage.Sheets[0].Cells[i2, 2].Tag = dt.Tables[0].Rows[i2]["Stage_id"].ToString(); FpSpreadstage.Sheets[0].Cells[i2, 3].Text = dt.Tables[0].Rows[i2]["Address"].ToString(); FarPoint.Web.Spread.ComboBoxCellType cmbcol = new FarPoint.Web.Spread.ComboBoxCellType(); cmbcol.ShowButton = true; cmbcol.UseValue = true; cmbcol.DataSource = dnew; //cmbcol.DataTextField = "textval"; //cmbcol.DataValueField = "textcode"; cmbcol.DataTextField = "District_Name"; //Modified by rajasekar on 11/05/2018 cmbcol.DataValueField = "District_Code"; //Modified by rajasekar on 11/05/2018 FpSpreadstage.Sheets[0].Columns[1].CellType = cmbcol; FpSpreadstage.Sheets[0].Cells[i2, 1].Text = Convert.ToString(dt.Tables[0].Rows[i2]["District"]); FpSpreadstage.Sheets[0].Cells[i2, 4].Value = 0; ddltypeview.Items.Add(dt.Tables[0].Rows[i2]["Stage_Name"].ToString()); } //30Nov2013======================================================== ddlcertificate.Items.Clear(); ddlcertificate.DataSource = dnew; //ddlcertificate.DataTextField = "textval"; //ddlcertificate.DataValueField = "textcode"; ddlcertificate.DataTextField = "District_Name"; //Modified by rajasekar on 11/05/2018 ddlcertificate.DataValueField = "District_Code"; //Modified by rajasekar on 11/05/2018 ddlcertificate.DataBind(); ddlcertificate.Items.Insert(0, ""); ddlvehicletypeview.Items.Clear(); ddlvehicletypeview.DataSource = dnew.Tables[0]; //ddlvehicletypeview.DataTextField = "textval"; //ddlvehicletypeview.DataValueField = "textcode"; ddlvehicletypeview.DataTextField = "District_Name"; //Modified by rajasekar on 11/05/2018 ddlvehicletypeview.DataValueField = "District_Code"; //Modified by rajasekar on 11/05/2018 ddlvehicletypeview.DataBind(); ddlvehicletypeview.Items.Insert(0, new ListItem("All", "-1")); //================================================================= FpSpreadstage.Sheets[0].PageSize = FpSpreadstage.Sheets[0].RowCount; } FpSpreadstage.SaveChanges(); }
public void online(string fbfk) { try { lbl_alrt.Visible = false; FpSpread1.Sheets[0].RowCount = 0; FpSpread1.Sheets[0].ColumnCount = 0; FpSpread1.CommandBar.Visible = false; FpSpread1.Sheets[0].AutoPostBack = false; FpSpread1.Sheets[0].ColumnHeader.RowCount = 2; FpSpread1.Sheets[0].RowHeader.Visible = false; FpSpread1.Sheets[0].ColumnCount = 3; FarPoint.Web.Spread.StyleInfo darkstyle = new FarPoint.Web.Spread.StyleInfo(); darkstyle.BackColor = ColorTranslator.FromHtml("#0CA6CA"); darkstyle.ForeColor = Color.White; FpSpread1.ActiveSheetView.ColumnHeader.DefaultStyle = darkstyle; FpSpread1.Visible = true; FarPoint.Web.Spread.ComboBoxCellType cmb = new FarPoint.Web.Spread.ComboBoxCellType(); cmb.AutoPostBack = false; FarPoint.Web.Spread.CheckBoxCellType cball = new FarPoint.Web.Spread.CheckBoxCellType(); cball.AutoPostBack = true; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No"; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Font.Bold = true; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].HorizontalAlign = HorizontalAlign.Center; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Font.Name = "Book Antiqua"; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].Columns[0].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Text = "Header"; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Font.Bold = true; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Font.Name = "Book Antiqua"; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Questions"; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Font.Bold = true; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Font.Name = "Book Antiqua"; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, 0, 2, 1); FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, 1, 2, 1); FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, 2, 2, 1); FpSpread1.Sheets[0].ColumnHeader.Columns[0].Width = 52; FpSpread1.Sheets[0].ColumnHeader.Columns[1].Width = 200; FpSpread1.Sheets[0].ColumnHeader.Columns[2].Width = 350; DataView dv = new DataView(); DataView filteroption_dv = new DataView(); ds.Clear(); string selqury = "select Batch_Year,DegreeCode,Section,semester,CollegeCode,Subject_Type,OptionalSubject_type,isnull(Acadamic_Isgeneral,0)Acadamic_Isgeneral,isnull(IsType_Individual,0)IsType_Individual,InclueCommon,isnull(IsSubjectType,0)IsSubjectType from CO_FeedBackMaster where FeedBackMasterPK='" + fbfk + "'"; ds = d2.select_method_wo_parameter(selqury, "Text"); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { ViewState["Acadamic_Isgeneral"] = null; string Acadamic_Isgeneral = Convert.ToString(ds.Tables[0].Rows[0]["Acadamic_Isgeneral"]); string Optiontypefilter = Convert.ToString(ds.Tables[0].Rows[0]["IsType_Individual"]); string IsSubjectType = Convert.ToString(ds.Tables[0].Rows[0]["IsSubjectType"]); if (IsSubjectType.Trim() == "1" || IsSubjectType.Trim() == "True") { lockNote.Visible = true; } else { lockNote.Visible = false; } if (Acadamic_Isgeneral.Trim() == "0" || Acadamic_Isgeneral.Trim() == "False") { #region acadamic string Deg_code = ds.Tables[0].Rows[0]["DegreeCode"].ToString(); string Batch = ds.Tables[0].Rows[0]["Batch_Year"].ToString(); string Semester = ds.Tables[0].Rows[0]["semester"].ToString(); string collegecode = Convert.ToString(ds.Tables[0].Rows[0]["CollegeCode"]); string section = ds.Tables[0].Rows[0]["Section"].ToString(); string subtype = ds.Tables[0].Rows[0]["Subject_Type"].ToString(); string subtype1 = ds.Tables[0].Rows[0]["OptionalSubject_type"].ToString(); string st_type = string.Empty; string st_type1 = string.Empty; string sub_type = string.Empty; string sub_type1 = string.Empty; string filteroption = string.Empty; if (!string.IsNullOrEmpty(subtype)) { st_type = subtype.ToString(); string[] split = st_type.Split(','); for (int i = 0; i < split.Length; i++) { if (string.IsNullOrEmpty(sub_type)) { sub_type = split[i]; } else { sub_type += "," + split[i]; } } } if (!string.IsNullOrEmpty(subtype1)) { st_type1 = subtype1.ToString(); string[] split = st_type1.Split(','); for (int i = 0; i < split.Length; i++) { if (string.IsNullOrEmpty(sub_type1)) { sub_type1 = split[i]; } else { sub_type1 += "," + split[i]; } } } if (!string.IsNullOrEmpty(sub_type1.Trim())) { if (string.IsNullOrEmpty(sub_type.Trim())) { sub_type = sub_type1; } else { sub_type = sub_type + "," + sub_type1; } } if (Optiontypefilter.Trim() == "1" || Optiontypefilter.Trim() == "True") { filteroption = "1"; } else { filteroption = "0"; } hat.Add("UnicodeValue", txt_unic_fb.Text.ToString()); hat.Add("CollegeCode", collegecode); hat.Add("degree_code", Deg_code); hat.Add("batch_year", Batch); hat.Add("Semester", Semester); hat.Add("sections", section); hat.Add("subjectType", sub_type); hat.Add("OptionalSubjectType", sub_type1); hat.Add("filteroptionmark", filteroption); ds.Clear(); ds = d2.select_method("FeedbackQuery", hat, "sp"); FarPoint.Web.Spread.ComboBoxCellType cb = new FarPoint.Web.Spread.ComboBoxCellType(); FarPoint.Web.Spread.TextCellType txt = new FarPoint.Web.Spread.TextCellType(); string optional = string.Empty; if (ds.Tables[4].Rows.Count > 0) { for (int p = 0; p < ds.Tables[4].Rows.Count; p++) { if (string.IsNullOrEmpty(optional)) { optional = ds.Tables[4].Rows[p]["subject_no"].ToString(); } else { optional = optional + "," + ds.Tables[4].Rows[p]["subject_no"].ToString(); } } Session["Optional subject"] = optional; } else { Session["Optional subject"] = ""; } if (ds.Tables[0].Rows.Count > 0 && ds.Tables[1].Rows.Count > 0 && ds.Tables[2].Rows.Count > 0 && ds.Tables[3].Rows.Count > 0) { lbl_Name.Visible = true; lbl_Name.Text = ds.Tables[0].Rows[0]["FeedBackName"].ToString(); if (ds.Tables[1].Rows.Count > 0) { for (int row = 0; row < ds.Tables[2].Rows.Count; row++) { FpSpread1.Sheets[0].ColumnCount++; FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Text = Convert.ToString(ds.Tables[2].Rows[row]["subject_name"]); FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Tag = Convert.ToString(ds.Tables[2].Rows[row]["subject_no"]); //FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Font.Bold = true; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Font.Name = "Book Antiqua"; //FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].HorizontalAlign = HorizontalAlign.Center; if (ds.Tables[3].Rows.Count > 0) { ds.Tables[3].DefaultView.RowFilter = "subject_no='" + Convert.ToString(ds.Tables[2].Rows[row]["subject_no"]) + "'"; dv = ds.Tables[3].DefaultView; if (dv.Count > 0) { for (int d = 0; d < dv.Count; d++) { if (d == 0) { FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].Text = Convert.ToString(dv[d]["staff_name"]); FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].Tag = Convert.ToString(dv[d]["staff_code"]); FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Note = Convert.ToString(ds.Tables[2].Rows[row]["subject_type"]); FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Tag = Convert.ToString(ds.Tables[2].Rows[row]["subject_no"]); //FpSpread1.Sheets[0].ColumnHeader.Cells[2, FpSpread1.Sheets[0].ColumnCount - 1].CellType = cball; } else { FpSpread1.Sheets[0].ColumnCount++; FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].Text = Convert.ToString(dv[d]["staff_name"]); FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].Tag = Convert.ToString(dv[d]["staff_code"]); FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Note = Convert.ToString(ds.Tables[2].Rows[row]["subject_type"]); FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Tag = Convert.ToString(ds.Tables[2].Rows[row]["subject_no"]); //FpSpread1.Sheets[0].ColumnHeader.Cells[2, FpSpread1.Sheets[0].ColumnCount - 1].CellType = cball; } //FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].Font.Bold = true; //FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].Font.Name = "Book Antiqua"; //FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].Font.Size = FontUnit.Medium; FpSpread1.Sheets[0].ColumnHeader.Cells[1, FpSpread1.Sheets[0].ColumnCount - 1].HorizontalAlign = HorizontalAlign.Center; //FpSpread1.Sheets[0].ColumnHeader.Cells[2, FpSpread1.Sheets[0].ColumnCount - 1].HorizontalAlign = HorizontalAlign.Center; //FpSpread1.Sheets[0].Columns[FpSpread1.Sheets[0].ColumnCount - 1].CellType = cb; } FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, FpSpread1.Sheets[0].ColumnCount - dv.Count, 1, dv.Count); } } } } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { FpSpread1.Sheets[0].RowCount++; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Text = Convert.ToString(i + 1); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Tag = ds.Tables[0].Rows[i]["FeedBackMasterPK"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Tag = ds.Tables[0].Rows[i]["HeaderCode"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Text = ds.Tables[0].Rows[i]["HeaderName"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].Text = ds.Tables[0].Rows[i]["Question"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 2].Tag = ds.Tables[0].Rows[i]["QuestionMasterPK"].ToString(); if (Optiontypefilter.Trim() == "1" || Optiontypefilter.Trim() == "True") { ds.Tables[1].DefaultView.RowFilter = " QuestionmasterFK='" + ds.Tables[0].Rows[i]["QuestionMasterPK"].ToString() + "' and FeedbackFk='" + ds.Tables[0].Rows[i]["FeedBackMasterPK"].ToString() + "'"; filteroption_dv = ds.Tables[1].DefaultView; cb = new FarPoint.Web.Spread.ComboBoxCellType(); cb.DataSource = filteroption_dv.ToTable(); cb.DataTextField = "MarkType"; cb.DataValueField = "MarkType"; if (filteroption_dv.Count == 0) { ds.Tables[1].DefaultView.RowFilter = " QuestionmasterFK='" + ds.Tables[0].Rows[i]["QuestionMasterPK"].ToString() + "'"; //filteroption_dv = ds.Tables[1].DefaultView.(true, "MarkType"); //filteroption_dv = ds.Tables[1].DefaultView(true, "MarkType"); DataTable dt = ds.Tables[1].DefaultView.ToTable(true, "MarkType"); cb = new FarPoint.Web.Spread.ComboBoxCellType(); cb.DataSource = dt; cb.DataTextField = "MarkType"; cb.DataValueField = "MarkType"; } } else { cb = new FarPoint.Web.Spread.ComboBoxCellType(); cb.DataSource = ds.Tables[1]; cb.DataTextField = "MarkType"; cb.DataValueField = "MarkType"; } for (int r = 3; r < FpSpread1.Sheets[0].ColumnCount; r++) { FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].CellType = cb; FpSpread1.Sheets[0].Columns[r].HorizontalAlign = HorizontalAlign.Center; if (IsSubjectType.Trim() == "1" || IsSubjectType.Trim() == "True")//Subject Wise { string subjectHeader = Convert.ToString(FpSpread1.Sheets[0].ColumnHeader.Cells[0, r].Note); bool flag = false;//delsi2303 string subjecttype = Convert.ToString(ds.Tables[0].Rows[i]["SubjectType"]); string[] subjectsplit = subjecttype.Split(','); if (subjectsplit.Length > 0) { for (int val = 0; val < subjectsplit.Length; val++) { string subjectstring = Convert.ToString(subjectsplit[val]); if (subjectstring.ToLower().Trim() == subjectHeader.ToLower().Trim()) { flag = true; } } } //if (!Convert.ToString(ds.Tables[0].Rows[i]["SubjectType"]).Contains(subjectHeader)) //{ // FpSpread1.Sheets[0].Cells[i, r].Locked = true; // FpSpread1.Sheets[0].Cells[i, r].BackColor = Color.Lavender; //} if (flag == false) //delsi2303 { FpSpread1.Sheets[0].Cells[i, r].Locked = true; FpSpread1.Sheets[0].Cells[i, r].BackColor = Color.Lavender; } } } } FpSpread1.Sheets[0].RowCount++;//txt FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Text = "Enter Comments"; for (int r = 3; r < FpSpread1.Sheets[0].ColumnCount; r++) { FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].CellType = txt; } FpSpread1.Sheets[0].Columns[0].Locked = true; FpSpread1.Sheets[0].Columns[1].Locked = true; FpSpread1.Sheets[0].Columns[2].Locked = true; FpSpread1.Width = 1000; FpSpread1.Height = 550; FpSpread1.Sheets[0].FrozenColumnCount = 1; FpSpread1.Sheets[0].FrozenColumnCount = 2; FpSpread1.Sheets[0].FrozenColumnCount = 3; FpSpread1.SaveChanges(); FpSpread1.Sheets[0].PageSize = FpSpread1.Sheets[0].RowCount; MainDivPart.Visible = true; } else { lbl_alrt.Visible = true; lbl_alrt.Text = "No Records Found"; txt_unic_fb.Text = ""; FpSpread1.Visible = false; btn_save.Visible = false; MainDivPart.Visible = false; } #endregion } if (Acadamic_Isgeneral.Trim() == "1" || Acadamic_Isgeneral.Trim() == "True") { #region Acadamic_Isgeneral DataView dv_hd = new DataView(); ViewState["Acadamic_Isgeneral"] = "1"; string Withoutquestiontype = "0"; if (Optiontypefilter.Trim() == "1" || Optiontypefilter.Trim() == "True") { Withoutquestiontype = "1"; } hat.Clear(); hat.Add("FeedbackFK", fbfk); hat.Add("CollegeCode", collegecode1); hat.Add("Withoutquestiontypematch", Withoutquestiontype); ds.Clear(); ds = d2.select_method("Feedback_acadamic_general", hat, "sp");//barath change procedure if (ds.Tables[2].Rows.Count > 0) { lbl_Name.Text = ds.Tables[2].Rows[0]["FeedBackName"].ToString(); } lbl_Name.Visible = true; FpSpread1.Columns[2].Visible = false; FpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Text = "Question"; if (ds.Tables[0].Rows.Count > 0 && ds.Tables[1].Rows.Count > 0) { for (int row = 0; row < ds.Tables[1].Rows.Count; row++) { FpSpread1.Sheets[0].ColumnCount++; FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, FpSpread1.Sheets[0].ColumnCount - 1, 2, 1); FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Text = Convert.ToString(ds.Tables[1].Rows[row]["MarkType"]); FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].Tag = Convert.ToString(ds.Tables[1].Rows[row]["MarkMasterPK"]); FpSpread1.Sheets[0].Columns[FpSpread1.Sheets[0].ColumnCount - 1].HorizontalAlign = HorizontalAlign.Center; FpSpread1.Sheets[0].ColumnHeader.Cells[0, FpSpread1.Sheets[0].ColumnCount - 1].HorizontalAlign = HorizontalAlign.Center; } FarPoint.Web.Spread.CheckBoxCellType chk = new FarPoint.Web.Spread.CheckBoxCellType(); chk.AutoPostBack = true; int sno = 0; string headername = ""; for (int i = 0; i < ds.Tables[3].Rows.Count; i++) { if (headername.Trim() != ds.Tables[3].Rows[i]["HeaderCode"].ToString()) { FpSpread1.Sheets[0].RowCount++; FpSpread1.Sheets[0].SpanModel.Add(FpSpread1.Sheets[0].RowCount - 1, 0, 1, FpSpread1.Sheets[0].ColumnCount); //FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Tag = ds.Tables[3].Rows[i]["HeaderCode"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Text = ds.Tables[3].Rows[i]["HeaderName"].ToString(); headername = ds.Tables[3].Rows[i]["HeaderCode"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].ForeColor = Color.Blue; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Font.Name = "Book Antiqua"; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Locked = true; } if (ds.Tables[0].Rows.Count > 0) { ds.Tables[0].DefaultView.RowFilter = " HeaderCode='" + ds.Tables[3].Rows[i]["HeaderCode"].ToString() + "' and QuestionMasterPK='" + ds.Tables[3].Rows[i]["QuestionMasterPK"].ToString() + "'"; dv_hd = ds.Tables[0].DefaultView; string prewquestionmasterfk = ""; bool checklock = false; if (dv_hd.Count > 0) { for (int rs = 0; rs < dv_hd.Count; rs++) { if (prewquestionmasterfk.Trim() != dv_hd[rs]["QuestionMasterPK"].ToString()) { FpSpread1.Sheets[0].RowCount++; sno++; checklock = true; } FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Text = Convert.ToString(sno); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Tag = dv_hd[rs]["FeedBackMasterPK"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Note = dv_hd[rs]["FeedBackMasterPK"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Text = dv_hd[rs]["Question"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Font.Name = "Book Antiqua"; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Tag = dv_hd[rs]["QuestionMasterPK"].ToString(); FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 0].Locked = true; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, 1].Locked = true; prewquestionmasterfk = dv_hd[rs]["QuestionMasterPK"].ToString(); //optionfilter if (Optiontypefilter.Trim() == "1" || Optiontypefilter.Trim() == "True") { for (int r = 3; r < FpSpread1.Sheets[0].ColumnHeader.Columns.Count; r++) { string markfk = Convert.ToString(FpSpread1.Sheets[0].ColumnHeader.Cells[0, r].Tag); if (Convert.ToString(dv_hd[rs]["MarkMasterFK"]) == markfk) { FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].Locked = false; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].CellType = chk; } else { FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].CellType = chk; if (checklock == true) { FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].Locked = true; } } } } else { for (int r = 3; r < FpSpread1.Sheets[0].ColumnHeader.Columns.Count; r++) { FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].Locked = false; FpSpread1.Sheets[0].Cells[FpSpread1.Sheets[0].RowCount - 1, r].CellType = chk; } } checklock = false; } } } } FpSpread1.Sheets[0].PageSize = FpSpread1.Sheets[0].RowCount; FpSpread1.Width = 800; FpSpread1.Height = 500; MainDivPart.Visible = true; btn_save.Visible = true; FpSpread1.Visible = true; FpSpread1.SaveChanges(); } else { imgdiv2.Visible = true; lbl_alert1.Text = "No Records Found"; FpSpread1.Visible = false; btn_save.Visible = false; } #endregion } } else { imgdiv2.Visible = true; lbl_alert1.Text = "No Records Found"; FpSpread1.Visible = false; btn_save.Visible = false; MainDivPart.Visible = false; } } else { imgdiv2.Visible = true; lbl_alert1.Text = "No Records Found"; FpSpread1.Visible = false; btn_save.Visible = false; MainDivPart.Visible = false; } } catch (Exception ex) { imgdiv2.Visible = true; lbl_alert1.Text = ex.ToString(); } }