Example #1
0
    public List <BLLEmployeeInfo> SelectEmployeeforChat(BLLEmployeeInfo objbll)
    {
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();

        SqlParameter param = new SqlParameter();

        param       = new SqlParameter("@emp_code", SqlDbType.NVarChar);
        param.Value = objbll.Emp_code;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectById("sp_selectempforchat", param);
        while (dr.Read())
        {
            objbll          = new BLLEmployeeInfo();
            objbll.Emp_code = dr["emp_code"].ToString();
            objbll.Name     = dr["name"].ToString();
            objbll.Pic_name = dr["pic_name"].ToString();
            objbll.Online   = Convert.ToBoolean(dr["online"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
Example #2
0
    public void SelectEmplnfo()
    {
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();
        BLLEmployeeInfo        objbll  = new BLLEmployeeInfo();

        objlist = objbll.SelectEmployeeInfo();
        if (objlist.Count > 0)
        {
            dgteacherinfo.DataSource = objlist;
            dgteacherinfo.DataBind();
            for (int i = 0; i <= dgteacherinfo.Rows.Count - 1; i++)
            {
                string update = (string)Session["update"];
                string delete = (string)Session["delete"];
                if (update == "yes")
                {
                    dgteacherinfo.Rows[i].Cells[1].Enabled = true;
                }
                else
                {
                    dgteacherinfo.Rows[i].Cells[1].Enabled = false;
                }
                if (delete == "yes")
                {
                    dgteacherinfo.Rows[i].Cells[2].Enabled = true;
                }
                else
                {
                    dgteacherinfo.Rows[i].Cells[2].Enabled = false;
                }
            }
        }
    }
Example #3
0
    public List <BLLEmployeeInfo> SelectEmpLogin(BLLEmployeeInfo objbll)
    {
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();

        SqlParameter[] param = new SqlParameter[2];

        param[0]       = new SqlParameter("@username", SqlDbType.NVarChar);
        param[0].Value = objbll.Username;

        param[1]       = new SqlParameter("@password", SqlDbType.NVarChar);
        param[1].Value = objbll.Password;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectEmplogin", param);
        while (dr.Read())
        {
            objbll          = new BLLEmployeeInfo();
            objbll.Emp_code = dr["emp_code"].ToString();
            objbll.Name     = dr["name"].ToString();
            objbll.Dep_id   = dr["dep_name"].ToString();
            objbll.Des_id   = dr["des_name"].ToString();
            objbll.Pic_name = dr["pic_name"].ToString();
            objbll.Pic_path = dr["pic_path"].ToString();
            objbll.Username = dr["username"].ToString();
            objbll.Password = dr["password"].ToString();
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
Example #4
0
    public void LoadForm()
    {
        BLLEmployeeInfo objbll = new BLLEmployeeInfo();

        objbll.Emp_code = (string)Session["emp_update"];
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();

        objlist = objbll.SelectEmployeeInfobyid(objbll);
        if (objlist.Count > 0)
        {
            txtemployeecode.Text = objlist[0].Emp_code;
            cmdDepartmants.Text  = objlist[0].Dep_id;
            cmbDesignation.Text  = objlist[0].Des_id;
            dateJoing.Text       = Convert.ToString(objlist[0].Joining_date);

            txtname.Text        = objlist[0].Name;
            txtfname.Text       = objlist[0].Father_name;
            cbgender.Text       = objlist[0].Gender;
            dtdob.Text          = Convert.ToString(objlist[0].Dob);
            txtcnic.Text        = objlist[0].Nic.ToString();
            txtnationality.Text = objlist[0].Nationality;
            txtmobileno.Text    = objlist[0].Mobile;
            txtphoneno.Text     = objlist[0].Phone;
            txtcaddress.Text    = objlist[0].C_address;
            txtpaddress.Text    = objlist[0].P_address;
            txtemail.Text       = objlist[0].Email;

            txtqualification.Text  = objlist[0].Qualification;
            txtspecialization.Text = objlist[0].Specialization;
            txtabout.Text          = objlist[0].About;
        }
    }
Example #5
0
    public void UpdateEmployeeInfo()
    {
        BLLEmployeeInfo objbll = new BLLEmployeeInfo();

        objbll.Emp_code     = (string)Session["emp_update"];
        objbll.Dep_id       = cmdDepartmants.SelectedItem.Value.ToString();
        objbll.Des_id       = cmbDesignation.SelectedItem.Value.ToString();
        objbll.Joining_date = Convert.ToDateTime(dateJoing.Value);
        objbll.Name         = txtname.Text;
        objbll.Father_name  = txtfname.Text;
        objbll.Gender       = cbgender.SelectedItem.ToString();
        objbll.Dob          = Convert.ToDateTime(dtdob.Value);
        objbll.Nic          = txtcnic.Text;
        objbll.Nationality  = txtnationality.Text;
        objbll.Mobile       = txtmobileno.Text;
        objbll.Phone        = txtphoneno.Text;
        objbll.C_address    = txtcaddress.Text;
        objbll.P_address    = txtpaddress.Text;
        objbll.Email        = txtemail.Text;

        objbll.Qualification  = txtqualification.Text;
        objbll.Specialization = txtspecialization.Text;
        objbll.About          = txtabout.Text;

        objbll.Modifiedby = user;

        int a = objbll.UpdateEmployeeInfo(objbll);

        if (a == 2)
        {
            lblresult.Text  = "Employee Information Update Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
Example #6
0
    protected void btndelete_Click(object sender, EventArgs e)
    {
        LinkButton obj = (LinkButton)(sender);
        string     val = obj.CommandArgument.ToString();

        BLLEmployeeInfo objbll = new BLLEmployeeInfo();

        objbll.Emp_code = val;
        int a = objbll.DeleteEmployeeInfo(objbll);

        SelectEmplnfo();
    }
Example #7
0
    public int DeleteEmployeeInfo(BLLEmployeeInfo objbll)
    {
        SqlParameter[] param = new SqlParameter[1];

        param[0]       = new SqlParameter("@emp_code", SqlDbType.NVarChar);
        param[0].Value = objbll.Emp_code;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_deleteemployee", param);

        objcon.CloseConnection();
        return(a);
    }
Example #8
0
    public void SelectEmpnamebycode()
    {
        BLLEmployeeInfo objbll = new BLLEmployeeInfo();

        objbll.Emp_code = cbemployeecode.SelectedItem.Value.ToString();
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();

        objlist = objbll.SelectEmpnamebycode(objbll);
        if (objlist.Count > 0)
        {
            txtname.Text = objlist[0].Name;
        }
    }
    public void SelectTeacherInfo()
    {
        BLLEmployeeInfo objbll = new BLLEmployeeInfo();

        objbll.Emp_code = user;
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();

        objlist = objbll.SelectEmpinfobycode(objbll);
        if (objlist.Count > 0)
        {
            dgprofile.DataSource = objlist;
            dgprofile.DataBind();
        }
    }
Example #10
0
    public void SelecEmpCode()
    {
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();
        BLLEmployeeInfo        objbll  = new BLLEmployeeInfo();

        objlist = objbll.SelectMaxEmpCode();
        if (objlist.Count > 0)
        {
            string reg1   = objlist[0].Emp_code;
            long   reg_no = Convert.ToInt64(reg1.Substring(2, 5));
            long   reg    = reg_no + 1;
            txtemployeecode.Text = Convert.ToString("E-" + reg);
        }
    }
Example #11
0
    public void SelectEmpcode()
    {
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();
        BLLEmployeeInfo        objbll  = new BLLEmployeeInfo();

        objlist = objbll.SelectEmployeeAdmincode();
        if (objlist.Count > 0)
        {
            cbemployeecode.DataSource = objlist;
            cbemployeecode.ValueField = "emp_code";
            cbemployeecode.TextField  = "emp_code";
            cbemployeecode.DataBind();
        }
    }
Example #12
0
    public List <BLLEmployeeInfo> SelectEmployeeInfobyid(BLLEmployeeInfo objbll)
    {
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();

        SqlParameter param = new SqlParameter();

        param       = new SqlParameter("@emp_code", SqlDbType.NVarChar);
        param.Value = objbll.Emp_code;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectById("sp_selectemployeeinfobyid", param);
        while (dr.Read())
        {
            objbll                = new BLLEmployeeInfo();
            objbll.Id             = Convert.ToInt32(dr["id"].ToString());
            objbll.Emp_code       = dr["emp_code"].ToString();
            objbll.Name           = dr["name"].ToString();
            objbll.Father_name    = dr["father_name"].ToString();
            objbll.C_address      = dr["c_address"].ToString();
            objbll.P_address      = dr["p_address"].ToString();
            objbll.Phone          = dr["phone"].ToString();
            objbll.Mobile         = dr["mobile"].ToString();
            objbll.Email          = dr["email"].ToString();
            objbll.Nic            = dr["nic"].ToString();
            objbll.Dob            = Convert.ToDateTime(dr["dob"].ToString());
            objbll.Nationality    = dr["nationality"].ToString();
            objbll.Dep_id         = dr["dep_id"].ToString();
            objbll.Des_id         = dr["des_id"].ToString();
            objbll.Qualification  = dr["qualification"].ToString();
            objbll.Specialization = dr["specialization"].ToString();
            objbll.About          = dr["about"].ToString();
            objbll.Joining_date   = Convert.ToDateTime(dr["joining_date"].ToString());
            objbll.Status         = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby      = dr["createdby"].ToString();
            objbll.Modifiedby     = dr["modifiedby"].ToString();
            objbll.Insert_date    = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date    = Convert.ToDateTime(dr["update_date"].ToString());
            objbll.Gender         = dr["gender"].ToString();
            objbll.Pic_name       = dr["pic_name"].ToString();
            objbll.Pic_path       = dr["pic_path"].ToString();
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
Example #13
0
    public List <BLLEmployeeInfo> SelectMaxEmpCode()
    {
        List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();
        BLLEmployeeInfo        objbll  = new BLLEmployeeInfo();

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectAll("sp_selectmaxempcode");
        while (dr.Read())
        {
            objbll          = new BLLEmployeeInfo();
            objbll.Emp_code = dr["emp_code"].ToString();
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
Example #14
0
    public void InsertEmployeeinfo()
    {
        BLLEmployeeInfo objbll = new BLLEmployeeInfo();

        objbll.Emp_code     = txtemployeecode.Text;;
        objbll.Dep_id       = cmdDepartmants.SelectedItem.Value.ToString();
        objbll.Des_id       = cmbDesignation.SelectedItem.Value.ToString();
        objbll.Joining_date = Convert.ToDateTime(dateJoing.Value);
        objbll.Name         = txtname.Text;
        objbll.Father_name  = txtfname.Text;
        objbll.Gender       = cbgender.SelectedItem.ToString();
        objbll.Dob          = Convert.ToDateTime(dtdob.Value);
        objbll.Nic          = txtcnic.Text;
        objbll.Nationality  = txtnationality.Text;
        objbll.Mobile       = txtmobileno.Text;
        objbll.Phone        = txtphoneno.Text;
        objbll.C_address    = txtcaddress.Text;
        objbll.P_address    = txtpaddress.Text;
        objbll.Email        = txtemail.Text;

        objbll.Username = txtemployeecode.Text;
        objbll.Password = Encrypt("usa".Trim());



        objbll.Qualification  = txtqualification.Text;
        objbll.Specialization = txtspecialization.Text;
        objbll.About          = txtabout.Text;

        objbll.Pic_name = ("~/Record_Images/" + ThumbnailFileName.ToString());
        objbll.Pic_path = "d";

        objbll.Createdby  = user;
        objbll.Modifiedby = user;

        int a = objbll.InsertEmployeeInfo(objbll);

        if (a == 4)
        {
            lblresult.Text  = "Employee Information Save Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
Example #15
0
    public int InsertEmployeeInfo(BLLEmployeeInfo objbll)
    {
        DALEmployeeInfo objdal = new DALEmployeeInfo();

        return(objdal.InsertEmployeeInfo(objbll));
    }
Example #16
0
    public int InsertEmployeeInfo(BLLEmployeeInfo objbll)
    {
        SqlParameter[] param = new SqlParameter[28];

        param[0]       = new SqlParameter("@emp_code", SqlDbType.NVarChar);
        param[0].Value = objbll.Emp_code;

        param[1]       = new SqlParameter("@name", SqlDbType.NVarChar);
        param[1].Value = objbll.Name;

        param[2]       = new SqlParameter("@father_name", SqlDbType.NVarChar);
        param[2].Value = objbll.Father_name;

        param[3]       = new SqlParameter("@c_address", SqlDbType.NVarChar);
        param[3].Value = objbll.C_address;

        param[4]       = new SqlParameter("@p_address", SqlDbType.NVarChar);
        param[4].Value = objbll.P_address;

        param[5]       = new SqlParameter("@phone", SqlDbType.NVarChar);
        param[5].Value = objbll.Phone;

        param[6]       = new SqlParameter("@mobile", SqlDbType.NVarChar);
        param[6].Value = objbll.Mobile;

        param[7]       = new SqlParameter("@email", SqlDbType.NVarChar);
        param[7].Value = objbll.Email;

        param[8]       = new SqlParameter("@nic", SqlDbType.NVarChar);
        param[8].Value = objbll.Nic;

        param[9]       = new SqlParameter("@dob", SqlDbType.DateTime);
        param[9].Value = objbll.Dob;

        param[10]       = new SqlParameter("@nationality", SqlDbType.NVarChar);
        param[10].Value = objbll.Nationality;

        param[11]       = new SqlParameter("@dep_id ", SqlDbType.NVarChar);
        param[11].Value = objbll.Dep_id;

        param[12]       = new SqlParameter("@des_id", SqlDbType.NVarChar);
        param[12].Value = objbll.Des_id;

        param[13]       = new SqlParameter("@joining_date ", SqlDbType.DateTime);
        param[13].Value = objbll.Joining_date;

        param[14]       = new SqlParameter("@status", SqlDbType.Bit);
        param[14].Value = objbll.Status;

        param[15]       = new SqlParameter("@createdby", SqlDbType.NVarChar);
        param[15].Value = objbll.Createdby;

        param[16]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[16].Value = objbll.Modifiedby;

        param[17]       = new SqlParameter("@Insert_Date", SqlDbType.DateTime);
        param[17].Value = objbll.Insert_date;

        param[18]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[18].Value = objbll.Update_date;

        param[19]       = new SqlParameter("@gender", SqlDbType.NVarChar);
        param[19].Value = objbll.Gender;

        param[20]       = new SqlParameter("@username", SqlDbType.NVarChar);
        param[20].Value = objbll.Username;

        param[21]       = new SqlParameter("@password ", SqlDbType.NVarChar);
        param[21].Value = objbll.Password;

        param[22]       = new SqlParameter("@pic_name", SqlDbType.NVarChar);
        param[22].Value = objbll.Pic_name;

        param[23]       = new SqlParameter("@pic_path ", SqlDbType.NVarChar);
        param[23].Value = objbll.Pic_path;

        param[24]       = new SqlParameter("@qualification ", SqlDbType.NVarChar);
        param[24].Value = objbll.Qualification;

        param[25]       = new SqlParameter("@specialization", SqlDbType.NVarChar);
        param[25].Value = objbll.Specialization;

        param[26]       = new SqlParameter("@about ", SqlDbType.NVarChar);
        param[26].Value = objbll.About;

        param[27]       = new SqlParameter("@online ", SqlDbType.NVarChar);
        param[27].Value = objbll.Online;

        objcon.OpenConnection();
        int a = objcon.sqlcmdInsert("sp_insertemployeeinfo", param);

        objcon.CloseConnection();
        return(a);
    }
Example #17
0
    public int UpdateEmployeeInfo(BLLEmployeeInfo objbll)
    {
        DALEmployeeInfo objdal = new DALEmployeeInfo();

        return(objdal.UpdateEmployeeInfo(objbll));
    }
Example #18
0
    public List <BLLEmployeeInfo> SelectEmployeeInfobyid(BLLEmployeeInfo objbll)
    {
        DALEmployeeInfo objdal = new DALEmployeeInfo();

        return(objdal.SelectEmployeeInfobyid(objbll));
    }
Example #19
0
    public int DeleteEmployeeInfo(BLLEmployeeInfo objbll)
    {
        DALEmployeeInfo objdal = new DALEmployeeInfo();

        return(objdal.DeleteEmployeeInfo(objbll));
    }
Example #20
0
    public int UpdateEmployeeInfo(BLLEmployeeInfo objbll)
    {
        SqlParameter[] param = new SqlParameter[20];

        param[0]       = new SqlParameter("@emp_code", SqlDbType.NVarChar);
        param[0].Value = objbll.Emp_code;

        param[1]       = new SqlParameter("@name", SqlDbType.NVarChar);
        param[1].Value = objbll.Name;

        param[2]       = new SqlParameter("@father_name", SqlDbType.NVarChar);
        param[2].Value = objbll.Father_name;

        param[3]       = new SqlParameter("@c_address", SqlDbType.NVarChar);
        param[3].Value = objbll.C_address;

        param[4]       = new SqlParameter("@p_address", SqlDbType.NVarChar);
        param[4].Value = objbll.P_address;

        param[5]       = new SqlParameter("@phone", SqlDbType.NVarChar);
        param[5].Value = objbll.Phone;

        param[6]       = new SqlParameter("@mobile", SqlDbType.NVarChar);
        param[6].Value = objbll.Mobile;

        param[7]       = new SqlParameter("@email", SqlDbType.NVarChar);
        param[7].Value = objbll.Email;

        param[8]       = new SqlParameter("@nic", SqlDbType.NVarChar);
        param[8].Value = objbll.Nic;

        param[9]       = new SqlParameter("@dob", SqlDbType.DateTime);
        param[9].Value = objbll.Dob;

        param[10]       = new SqlParameter("@nationality", SqlDbType.NVarChar);
        param[10].Value = objbll.Nationality;

        param[11]       = new SqlParameter("@dep_id ", SqlDbType.NVarChar);
        param[11].Value = objbll.Dep_id;

        param[12]       = new SqlParameter("@des_id", SqlDbType.NVarChar);
        param[12].Value = objbll.Des_id;

        param[13]       = new SqlParameter("@joining_date ", SqlDbType.DateTime);
        param[13].Value = objbll.Joining_date;

        param[14]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[14].Value = objbll.Modifiedby;

        param[15]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[15].Value = objbll.Update_date;

        param[16]       = new SqlParameter("@gender", SqlDbType.NVarChar);
        param[16].Value = objbll.Gender;

        param[17]       = new SqlParameter("@qualification ", SqlDbType.NVarChar);
        param[17].Value = objbll.Qualification;

        param[18]       = new SqlParameter("@specialization", SqlDbType.NVarChar);
        param[18].Value = objbll.Specialization;

        param[19]       = new SqlParameter("@about ", SqlDbType.NVarChar);
        param[19].Value = objbll.About;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_updateemployeeinfo", param);

        objcon.CloseConnection();
        return(a);
    }
Example #21
0
    public List <BLLEmployeeInfo> SelectEmpnamebycode(BLLEmployeeInfo objbll)
    {
        DALEmployeeInfo objdal = new DALEmployeeInfo();

        return(objdal.SelectEmpnamebycode(objbll));
    }
    public void SelectEmpLogin()
    {
        string us = txtusername.Text.Substring(0, 1);

        if (us == "e")
        {
            BLLEmployeeInfo objbll = new BLLEmployeeInfo();
            objbll.Username = txtusername.Text;
            objbll.Password = Encrypt(txtpasssword.Text);
            List <BLLEmployeeInfo> objlist = new List <BLLEmployeeInfo>();
            objlist = objbll.SelectEmpLogin(objbll);
            if (objlist.Count > 0)
            {
                DateTime dt     = DateTime.Now;
                string   signin = String.Format("{0:F}", dt);

                string user     = objlist[0].Username;
                string name     = objlist[0].Name;
                string password = Decrypt(objlist[0].Password);
                string dep_id   = objlist[0].Dep_id;
                string des_id   = objlist[0].Des_id;
                string pic_name = objlist[0].Pic_name;

                if (password == "usa")
                {
                    Session["pass"]     = "******";
                    Session["username"] = user;
                    Session["dep_id"]   = dep_id;
                    Response.Redirect("ChangePasword.aspx");
                }
                if (dep_id == "Faculty")
                {
                    Session["teacher"]  = user;
                    Session["username"] = user;
                    Session["name"]     = name;
                    Session["des_id"]   = des_id;
                    Session["pic_name"] = pic_name;
                    Session["signin"]   = signin;
                    Session["dep_id"]   = dep_id;
                    Response.Redirect("../TeacherWebPages/teacher.aspx");
                }
                else
                {
                    Session["user"]     = user;
                    Session["username"] = user;
                    Session["name"]     = name;
                    Session["des_id"]   = des_id;
                    Session["pic_name"] = pic_name;
                    Session["signin"]   = signin;
                    Session["dep_id"]   = dep_id;
                    Response.Redirect("../WebPages/admin.aspx");
                }
            }
            else
            {
                lblresult.Text   = "Enter Valid Username and Password";
                txtusername.Text = string.Empty;
                txtusername.Focus();
            }
        }
        else
        {
            BLLStudentInfo objbll = new BLLStudentInfo();
            objbll.Username = txtusername.Text;
            objbll.Password = Encrypt(txtpasssword.Text);
            List <BLLStudentInfo> objlist = new List <BLLStudentInfo>();
            objlist = objbll.SelectStuLogin(objbll);
            if (objlist.Count > 0)
            {
                DateTime dt     = DateTime.Now;
                string   signin = String.Format("{0:F}", dt);

                string user     = objlist[0].Username;
                string name     = objlist[0].Name;
                string password = Decrypt(objlist[0].Password);

                string pic_name = objlist[0].Pic_name;

                if (password == "usa")
                {
                    Session["pass"]     = "******";
                    Session["username"] = user;
                    Session["dep_id"]   = "Student";
                    Response.Redirect("ChangePasword.aspx");
                }
                else
                {
                    Session["student"]  = user;
                    Session["username"] = user;
                    Session["name"]     = name;
                    Session["des_id"]   = "Student";
                    Session["pic_name"] = pic_name;
                    Session["signin"]   = signin;
                    Session["dep_id"]   = "Student";
                    Response.Redirect("../StudentWebPages/student.aspx");
                }
            }
            else
            {
                lblresult.Text   = "Enter Valid Username and Password";
                txtusername.Text = string.Empty;
                txtusername.Focus();
            }
        }
    }