Exemple #1
0
        /// <summary>
        /// 根据id修改考勤类型
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int upatttapyByID(AttendanceInfo att)
        {
            sqltext = "update [dbo].[AttendanceInfo] set[Name]='" + att.Name + "',[Introduce]='" + att.Introduce + "',[Praise]=" + att.Praise + ",[Punish]=" + att.Punish + " where [AtId]=" + att.AtId + "";
            int i = (int)SQLHelper.ExecuteNonQuery(sqltext);

            return(i);
        }
Exemple #2
0
        /// <summary>
        /// 添加考勤类型
        /// </summary>
        /// <param name="userinfo"></param>
        /// <returns></returns>
        public static int addATTTYPE(AttendanceInfo att)
        {
            sqltext = "insert [dbo].[AttendanceInfo]([Name],[Introduce],[Praise],[Punish])values('" + att.Name + "','" + att.Introduce + "'," + att.Praise + "," + att.Punish + ")";
            int i = (int)SQLHelper.ExecuteNonQuery(sqltext);

            return(i);
        }
Exemple #3
0
        /// <summary>
        /// 根据id查找类别
        /// </summary>
        /// <param name="US"></param>
        /// <returns></returns>
        public static AttendanceInfo SelectattInfoByid(string id)
        {
            AttendanceInfo att = new AttendanceInfo();

            sqltext = "select * from[dbo].[AttendanceInfo] where [AtId]=1";
            DataSet ds = new DataSet();

            ds = SQLHelper.ExecuteDataSet(sqltext);

            DataTable dt = new DataTable();

            dt = ds.Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                att.Name      = dr["Name"].ToString();
                att.Introduce = dr["Introduce"].ToString();
                att.Praise    = Convert.ToInt32(dr["Praise"]);
                att.Punish    = Convert.ToInt32(dr["Punish"]);
            }
            return(att);
        }