protected void btn_create_Click(object sender, EventArgs e) { int fac = 185; string j1 = objFunc.Get_details("select count(*) from papers where f_id='" + fac + "' and area_of_intrst='" + ddl_aoi.SelectedValue + "'"); int i1 = Convert.ToInt32(j1); if (i1 == 0) { int i = objFunc.ExecuteDML("insert into papers(f_id,area_of_intrst) values('" + fac + "','" + ddl_aoi.SelectedValue + "')"); if (i == 1) { objFunc.MsgBox("Record Added Sucessfully...", this); grd_quiz.Visible = true; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { for (int i = 0; i < Gvresult.Rows.Count; i++) { CheckBox chkrslt = (CheckBox)Gvresult.Rows[i].FindControl("ChkResult"); string check; string dtky = Gvresult.DataKeys[i].Value.ToString(); if (chkrslt.Checked == true) { check = "Yes"; string sql = "INSERT INTO resultrecord(Course,Specialisation,Trimester,InstituteID,Session,UserEntryID,UserEntryDate,SubjectId,ResultStatus) VALUES('" + ddlCourse.SelectedValue + "','" + ddlspl.SelectedValue + "','" + ddltremester.SelectedValue + "','" + Session["instID"].ToString() + "','" + Session["sesnID"].ToString() + "','" + Session["UID"].ToString() + "','" + DateTime.Now + "','" + dtky + "','" + check + "');"; objfun.ExecuteDML(sql); objfun.ExecuteDML("Select Subject_Mast.SubjectName+' ('+Subject_Mast.SubjectCode+')' as Subject FROM iESEresult INNER JOIN Subject_Mast ON iESEresult.SubjectId = Subject_Mast.SubjectID WHERE iESEresult.SubjectId=dtky "); } } DataTable dt1 = new DataTable(); dt1 = objfun.FillDataTable("SELECT DISTINCT iESEresult.SubjectId, Subject_Mast.SubjectName+' ('+Subject_Mast.SubjectCode+')' as Subject FROM iESEresult INNER JOIN Subject_Mast ON iESEresult.SubjectId = Subject_Mast.SubjectID WHERE(iESEresult.courseId = '" + ddlCourse.SelectedValue + "') AND (iESEresult.yearId = '" + ddltremester.SelectedValue + "') AND (iESEresult.SpecializationId='" + ddlspl.SelectedValue + "') AND (iESEresult.InstituteID = '" + Session["instID"].ToString() + "') AND (iESEresult.sessionId= '" + Session["sesnID"].ToString() + "') AND iESEresult.SubjectId NOT IN (Select SubjectId from resultrecord)"); if (dt1.Rows.Count == 0) { Gvresult.Visible = false; imgnodata.Visible = true; } if (dt1.Rows.Count > 0) { Gvresult.Visible = true; imgnodata.Visible = false; } BindGrid(); if (Gvresult.Rows.Count != 0) { } }
public int insertApply_detls(int aply, int J_Idd) { string st_name = ""; int branch = 0; int course = 0; string batch = ""; int sem = 0; int comp_id = 0; int job_id = 0; decimal ctOff = 0; int Jbak = 0; int Jgap = 0; int Jcoff = 0; string status = ""; int Mmarks = 0; decimal Obt = 0.0m; int bak = Convert.ToInt32(objFunc.Get_details("select COUNT(StudentID) from ibackpaperDetails where StudentID=" + Application["uid"] + "")); int gap = Convert.ToInt32(objFunc.Get_details("select SUM(Gap) from StudentAcademicDetail where StudentID=" + Application["uid"] + "")); DataTable dt = objFunc.FillDataTable("select top 1 * from student_por_view where studentid=" + Application["uid"] + ""); DataTable dt1 = objFunc.FillDataTable("select * from Stud_Aply_Cid_View where comp_id=" + Convert.ToInt32(aply) + " and job_id=" + J_Idd + ""); int checkExist = Convert.ToInt32(objFunc.Get_details("select count(*) from iESEresult where studentId=" + Application["uid"] + "")); if (checkExist != 0) { DataTable dt2 = objFunc.FillDataTable("select SUM(isnull(MaxMrks,0)) as MaxMrks,SUM(isnull(MarksObtain,0)) as MarksObtain from iESEresult where studentId=" + Application["uid"] + ""); if (dt2.Rows.Count > 0) { for (int k = 0; k < dt2.Rows.Count; k++) { string de = dt2.Rows[k]["MarksObtain"].ToString(); Mmarks = Convert.ToInt32(dt2.Rows[k]["MaxMrks"].ToString()); Obt = Convert.ToDecimal(de); } ctOff = (Obt * 100) / Mmarks; } } else { ctOff = 0.00M; } DataTable DTmrk = objFunc.FillDataTable("select * from Job_Qualification_percentage where Job_id=" + J_Idd + ""); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { st_name = dt.Rows[i]["StudentName"].ToString(); branch = Convert.ToInt32(dt.Rows[i]["Specialization"].ToString()); course = Convert.ToInt32(dt.Rows[i]["CourseID"].ToString()); batch = dt.Rows[i]["Batch"].ToString(); sem = Convert.ToInt32(dt.Rows[i]["SemesterID"].ToString()); } } //=================================================Job DEtail decimal J_Hig_S = Convert.ToDecimal(objFunc.Get_details("select (isnull(Cut_off,0)) from Job_Qualification_percentage where Job_id=" + J_Idd + " and Qualification_id='1'")); decimal J_InterM = Convert.ToDecimal(objFunc.Get_details("select (isnull(Cut_off,0))from Job_Qualification_percentage where Job_id=" + J_Idd + " and Qualification_id='2'")); decimal J_UG = Convert.ToDecimal(objFunc.Get_details("select (isnull(Cut_off,0)) from Job_Qualification_percentage where Job_id=" + J_Idd + " and Qualification_id='3'")); decimal J_PG = Convert.ToDecimal(objFunc.Get_details("select (isnull(Cut_off,0)) from Job_Qualification_percentage where Job_id=" + J_Idd + " and Qualification_id='4'")); //================================================STUD_Detail int count_S_High = 0; int count_S_InterM = 0; int Count_S_UG = 0; decimal S_High = 0.0M; decimal S_InterM = 0.0M; decimal S_UG = 0.0M; count_S_High = Convert.ToInt32(objFunc.Get_details("select count(*) from StudentAcademicDetail where StudentID=" + Application["uid"] + " and QualificationID='1'")); if (count_S_High > 0) { S_High = Convert.ToDecimal(objFunc.Get_details("select isnull(RankPercentage,0) from StudentAcademicDetail where StudentID=" + Application["uid"] + " and QualificationID='1'")); } count_S_InterM = Convert.ToInt32(objFunc.Get_details("select count(*) from StudentAcademicDetail where StudentID=" + Application["uid"] + " and QualificationID='2'")); if (count_S_InterM > 0) { S_InterM = Convert.ToDecimal(objFunc.Get_details("select isnull(RankPercentage,0) from StudentAcademicDetail where StudentID=" + Application["uid"] + " and QualificationID='2'")); } string nature = objFunc.Get_details("select CourseNature from course where CourseId=" + course + ""); if (nature == "PG") { Count_S_UG = Convert.ToInt32(objFunc.Get_details("select count(*) from StudentAcademicDetail where StudentID=" + Application["uid"] + " and QualificationID='3'")); if (Count_S_UG > 0) { S_UG = Convert.ToDecimal(objFunc.Get_details("select isnull(RankPercentage,0) from StudentAcademicDetail where StudentID=" + Application["uid"] + " and QualificationID='3'")); } } else { S_UG = ctOff; } decimal S_PG = ctOff; //=============================================================== if (dt1.Rows.Count > 0) { for (int j = 0; j < dt1.Rows.Count; j++) { comp_id = Convert.ToInt32(dt1.Rows[j]["Comp_ID"].ToString()); job_id = Convert.ToInt32(dt1.Rows[j]["job_id"].ToString()); Jbak = Convert.ToInt32(dt1.Rows[j]["b_log"].ToString()); Jgap = Convert.ToInt32(dt1.Rows[j]["e_gap"].ToString()); //Jcoff = Convert.ToInt32(dt1.Rows[j]["cutt_off"].ToString()); } } if (nature == "PG") { if (Jbak >= bak && Jgap >= gap && J_Hig_S <= S_High && J_InterM <= S_InterM && J_UG <= S_UG && J_PG <= S_PG) { status = "Applied"; } else { status = "Waiting"; } } else { if (Jbak >= bak && Jgap >= gap && J_Hig_S <= S_High && J_InterM <= S_InterM && J_UG <= S_UG) { status = "Applied"; } else { status = "Waiting"; } } string sjd = "insert into stud_applydetails (job_id, comp_id, stud_id, stud_name, branch_id, batch, Sem_ID, course_id, cut_off, backlog, status, edu_gap, session_id, inst_id) values (" + job_id + ", " + comp_id + "," + Application["uid"] + ", '" + st_name + "'," + branch + ",'" + batch + "'," + sem + "," + course + "," + ctOff + ", " + bak + ", '" + status + "'," + gap + ",'" + Application["sesnID"] + "'," + Application["instID"] + ")"; int value = objFunc.ExecuteDML(sjd); return(value); }