public string respondOfferDAL(string username, string password) { SetJobStatus ss = new SetJobStatus(); try { conOpen.Open(); SqlCommand cmd1 = new SqlCommand("select DL_Designation,DL_Role from E_Data_Login where DL_LoginID='" + username + "' and DL_Password='******' ", conOpen); var dr = cmd1.ExecuteReader(); CheckLogin cl = new CheckLogin(); while (dr.Read()) { if (dr.IsDBNull(0)) { cl.designation = null; } else { cl.designation = dr.GetString(0); } if (dr.IsDBNull(1)) { cl.role = null; } else { cl.role = dr.GetString(1); } } if (dr.HasRows) { dr.Close(); SqlCommand cmd = new SqlCommand("select Offer_Letter_Status from E_Data_Candidate_Profile where Can_CandidateID='" + username + "' ", conOpen); var dr1 = cmd.ExecuteReader(); while (dr1.Read()) { if (dr1.IsDBNull(0)) { ss.offerstatus = null; } else { ss.offerstatus = dr1.GetString(0); } } } } catch (Exception ex) { Console.WriteLine(ex); } return(ss.offerstatus); }
public List <SetJobStatus> CheckCanOfferDAL() { List <SetJobStatus> li = new List <SetJobStatus>(); try { conOpen.Open(); SqlCommand cmd = new SqlCommand("select Can_CandidateID,Can_TestStatus,Can_BCGTestStatus,Offer_Letter_Status from E_Data_Candidate_Profile where Offer_Letter_Status='Accept' and Can_IsDeleted=0 and Can_BCGTestStatus=1 ", conOpen); var dr = cmd.ExecuteReader(); while (dr.Read()) { SetJobStatus ss = new SetJobStatus(); ss.candidateid = dr.GetInt32(0); ss.interviewstatus = Convert.ToString(dr.GetInt32(1)); if (ss.interviewstatus.Equals("6")) { ss.interviewstatus = "Approved"; } ss.bgcstatus = Convert.ToString(dr.GetBoolean(2)); if (ss.bgcstatus.Equals("true")) { ss.bgcstatus = "Cleared"; } ss.offerstatus = dr.GetString(3); li.Add(ss); } } catch (Exception ex) { Console.WriteLine(ex); } return(li); }