示例#1
0
        public int EmpInfoDelete(getZhigong Empinfo)
        {
            int intFalg = 0;

            try
            {
                string str_Del = "update EmpIoy set ";
                str_Del += "EmpFalg='" + Empinfo.getEmpFalg + "' where  EmpId='" + Empinfo.getEmpId + "'";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Del, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();
                return(intFalg);
            }
            catch (Exception ee)
            {
                return(intFalg);
            }
        }
示例#2
0
        public int EmpInfoUpdate(getZhigong Empinfo)
        {
            int intFalg = 0;

            try
            {
                string str_Update = "update EmpIoy set ";
                str_Update += "EmpName='" + Empinfo.getEmpName + "',EmpLoginName='" + Empinfo.getEmpLoginName + "',";
                str_Update += "EmpLoginPwd='" + Empinfo.getEmpLoginPwd + "',EmpSex='" + Empinfo.getEmpSex + "',EmpBirthday='" + Empinfo.getEmpBirthday + "',";
                str_Update += "EmpPhone='" + Empinfo.getEmpPhone + "',";
                str_Update += "EmpFalg=" + Empinfo.getEmpFalg + " where  EmpId='" + Empinfo.getEmpId + "'";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Update, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();
                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
示例#3
0
        public int EmpInfoAdd(getZhigong Empinfo)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into EmpIoy values( ";
                str_Add += " '" + Empinfo.getEmpId + "','" + Empinfo.getEmpName + "','" + Empinfo.getEmpLoginName + "',";
                str_Add += " '" + Empinfo.getEmpLoginPwd + "','" + Empinfo.getEmpSex + "','" + Empinfo.getEmpBirthday + "',";
                str_Add += " '" + Empinfo.getEmpPhone + "',";
                str_Add += Empinfo.getEmpFalg + ")";
                getSqlConnection getConnection = new getSqlConnection();
                conn    = getConnection.GetCon();
                cmd     = new SqlCommand(str_Add, conn);
                intFalg = cmd.ExecuteNonQuery();
                conn.Dispose();
                return(intFalg);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }