Esempio n. 1
0
        public bool AddEmployeeResume(CPersonnelResume Resume)
        {
            if (Resume == null)
            {
                return(false);
            }

            List <OleDbParameter> Param = new List <OleDbParameter>();

            Param.Add(Db.MakeInParam("PersonnelID", System.Data.OleDb.OleDbType.BigInt, 8, Resume.PersonnelID));
            Param.Add(Db.MakeInParam("Resume", System.Data.OleDb.OleDbType.VarChar, 2048, Resume.Resume));
            Param.Add(Db.MakeInParam("Portrait", System.Data.OleDb.OleDbType.LongVarBinary, 0, Resume.Portrait));
            Param.Add(Db.MakeInParam("Fere", System.Data.OleDb.OleDbType.VarChar, 50, Resume.Fere));
            Param.Add(Db.MakeInParam("FerePhone", System.Data.OleDb.OleDbType.VarChar, 50, Resume.FerePhone));
            Param.Add(Db.MakeInParam("Father", System.Data.OleDb.OleDbType.VarChar, 50, Resume.Father));
            Param.Add(Db.MakeInParam("FatherPhone", System.Data.OleDb.OleDbType.VarChar, 50, Resume.FatherPhone));
            Param.Add(Db.MakeInParam("Mater", System.Data.OleDb.OleDbType.VarChar, 50, Resume.Mater));
            Param.Add(Db.MakeInParam("MaterPhone", System.Data.OleDb.OleDbType.VarChar, 50, Resume.MaterPhone));
            Param.Add(Db.MakeInParam("Wedded", System.Data.OleDb.OleDbType.Integer, 4, Resume.Wedded));

            if (Db.ExecSql(@"INSERT INTO tPersonnelResume(PersonnelID,Resume,Portrait,Fere,FerePhone,Father, FatherPhone,Mater,MaterPhone,Wedded) VALUES (?, ?, ?, ?, ?,  ?, ?, ?, ?, ?)", Param) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public bool UpdateEmployeeResume(CPersonnelResume Resume)
        {
            if (Resume == null)
            {
                return(false);
            }

            int PortraitLen = 0;

            if (Resume.Portrait != null)
            {
                PortraitLen = Resume.Portrait.Length;
            }

            List <OleDbParameter> Param = new List <OleDbParameter>();

            Param.Add(Db.MakeInParam("PersonnelID", System.Data.OleDb.OleDbType.BigInt, 8, Resume.PersonnelID));
            Param.Add(Db.MakeInParam("Resume", System.Data.OleDb.OleDbType.VarChar, 2048, Resume.Resume));
            if (PortraitLen > 0)
            {
                Param.Add(Db.MakeInParam("Portrait", System.Data.OleDb.OleDbType.LongVarBinary, PortraitLen, Resume.Portrait));
            }
            Param.Add(Db.MakeInParam("Fere", System.Data.OleDb.OleDbType.VarChar, 50, Resume.Fere));
            Param.Add(Db.MakeInParam("FerePhone", System.Data.OleDb.OleDbType.VarChar, 50, Resume.FerePhone));
            Param.Add(Db.MakeInParam("Father", System.Data.OleDb.OleDbType.VarChar, 50, Resume.Father));
            Param.Add(Db.MakeInParam("FatherPhone", System.Data.OleDb.OleDbType.VarChar, 50, Resume.FatherPhone));
            Param.Add(Db.MakeInParam("Mater", System.Data.OleDb.OleDbType.VarChar, 50, Resume.Mater));
            Param.Add(Db.MakeInParam("MaterPhone", System.Data.OleDb.OleDbType.VarChar, 50, Resume.MaterPhone));
            Param.Add(Db.MakeInParam("Wedded", System.Data.OleDb.OleDbType.Integer, 4, Resume.Wedded));

            string CommandText = "Update tPersonnelResume Set Resume=?,Fere=?,FerePhone=?,Father=?,FatherPhone=?,Mater=?,MaterPhone=?,Wedded=? where PersonnelID=?";

            if (PortraitLen > 0)
            {
                CommandText = "Update tPersonnelResume Set Resume=?,Portrait=?,Fere=?,FerePhone=?,Father=?,FatherPhone=?,Mater=?,MaterPhone=?,Wedded=? where PersonnelID=?";
            }
            else
            {
            }
            if (Db.ExecSql(CommandText, Param) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        public CPersonnelResume GetEmployeeResume(long EmployeeID)
        {
            CPersonnelResume EmployeeResume = new CPersonnelResume();

            List <OleDbParameter> Param = new List <OleDbParameter>();

            Param.Add(Db.MakeInParam("PersonnelID", System.Data.OleDb.OleDbType.BigInt, 8, EmployeeID));

            DataTable dt = Db.GetDataTable(@"Select * From tPersonnelResume where PersonnelID=?", Param);

            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                EmployeeResume.PersonnelID = EmployeeID;
                EmployeeResume.Father      = dr["Father"].ToString();
                EmployeeResume.FatherPhone = dr["FatherPhone"].ToString();
                EmployeeResume.Fere        = dr["Fere"].ToString();
                EmployeeResume.FerePhone   = dr["FerePhone"].ToString();
                EmployeeResume.Mater       = dr["Mater"].ToString();
                EmployeeResume.MaterPhone  = dr["MaterPhone"].ToString();

                object obytes = dr["Portrait"];
                if (obytes.ToString() != "")
                {
                    EmployeeResume.Portrait = (byte[])obytes;
                }
                else
                {
                    EmployeeResume.Portrait = null;
                }

                EmployeeResume.Resume = dr["Resume"].ToString();
                EmployeeResume.Wedded = Convert.ToInt32(dr["Wedded"]);

                return(EmployeeResume);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 4
0
 public FormEmployeeInfo()
 {
     m_Personnel       = new CPersonnel();
     m_PersonnelResume = new CPersonnelResume();
     InitializeComponent();
 }
Esempio n. 5
0
        void ModEmployeeInfo()
        {
            if (dgvEmployee.CurrentRow != null)
            {
                FormEmployeeInfo dlg = new FormEmployeeInfo();

                DataRowView drv = (DataRowView)dgvEmployee.CurrentRow.DataBoundItem;

                dlg.m_Personnel.Name    = drv["Name"].ToString();
                dlg.m_Personnel.Alias   = drv["Alias"].ToString();
                dlg.m_Personnel.Addrees = drv["Addrees"].ToString();
                if (!Convert.IsDBNull(drv["Birth"]))
                {
                    dlg.m_Personnel.Birth = Convert.ToDateTime(drv["Birth"]);
                }
                dlg.m_Personnel.EduLevel = drv["EduLevel"].ToString();
                dlg.m_Personnel.EMail    = drv["EMail"].ToString();
                dlg.m_Personnel.Fax      = drv["Fax"].ToString();

                if (!Convert.IsDBNull(drv["HoldDate"]))
                {
                    dlg.m_Personnel.HoldDate = Convert.ToDateTime(drv["HoldDate"]);
                }
                dlg.m_Personnel.HomePhone    = drv["HomePhone"].ToString();
                dlg.m_Personnel.IdentityCard = drv["IdentityCard"].ToString();
                dlg.m_Personnel.MobilePhone  = drv["MobilePhone"].ToString();
                dlg.m_Personnel.MSN          = drv["MSN"].ToString();

                if (!Convert.IsDBNull(drv["Outjob"]))
                {
                    dlg.m_Personnel.Outjob = Convert.ToInt32(drv["Outjob"]);
                }
                dlg.m_Personnel.PersonnelID = Convert.ToInt32(drv["PersonnelID"]);
                dlg.m_Personnel.QQ          = drv["QQ"].ToString();
                dlg.m_Personnel.Sex         = drv["Sex"].ToString();
                dlg.m_Personnel.WorkAddress = drv["WorkAddress"].ToString();
                dlg.m_Personnel.WorkID      = drv["WorkID"].ToString();
                dlg.m_Personnel.WorkPhone   = drv["WorkPhone"].ToString();

                if (!Convert.IsDBNull(drv["Contract"]))
                {
                    dlg.m_Personnel.ContractDate = Convert.ToDateTime(drv["Contract"]);
                }
                if (!Convert.IsDBNull(drv["DimissionDate"]))
                {
                    dlg.m_Personnel.DimissionDate = Convert.ToDateTime(drv["DimissionDate"]);
                }

                dlg.m_PersonnelResume.PersonnelID = dlg.m_Personnel.PersonnelID;

                CPersonnelResume PersonnelResume = m_DbAdaHelper.GetEmployeeResume(dlg.m_Personnel.PersonnelID);
                if (PersonnelResume != null)
                {
                    dlg.m_PersonnelResume = PersonnelResume;
                }

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    m_DbAdaHelper.UpdateEmployee(dlg.m_Personnel);
                    m_DbAdaHelper.UpdateEmployeeResume(dlg.m_PersonnelResume);
                }
                dgvEmployee.DataSource = m_DbAdaHelper.GetEmployee();
            }
        }