Ejemplo n.º 1
0
        public CheckLogin LoginDAL(string username, string password)
        {
            CheckLogin cl = new CheckLogin();

            try
            {
                conOpen.Open();
                SqlCommand cmd = new SqlCommand("select DL_LoginID,DL_Password, DL_Designation,DL_Role from E_Data_Login   where DL_LoginID='" + username + "' ", conOpen);
                var        dr  = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        if (dr.IsDBNull(0))
                        {
                            cl.username = null;
                        }
                        else
                        {
                            cl.username = Convert.ToString(dr.GetInt32(0));
                        }
                        if (dr.IsDBNull(1))
                        {
                            cl.password = null;
                        }
                        else
                        {
                            cl.password = dr.GetString(1);
                        }

                        if (dr.IsDBNull(2))
                        {
                            cl.designation = null;
                        }
                        else
                        {
                            cl.designation = dr.GetString(2);
                        }
                        if (dr.IsDBNull(3))
                        {
                            cl.role = null;
                        }
                        else
                        {
                            cl.role = dr.GetString(3);
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            return(cl);
        }
Ejemplo n.º 2
0
        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);
        }