Example #1
0
        public static int UpdateLendAptitude(UCertificatLend Lend, ref string a_strErr)
        {
            int      intInsert = 0;
            int      intupdate = 0;
            SQLTrans sqlTrans  = new SQLTrans();

            sqlTrans.Open("SupplyCnn");

            string strInsert = "update tk_UCertificatLend set ReturnDate = '" + Lend.StrReturnDate + "' where ID = '" + Lend.StrID + "'";
            string strUpdate = "update tk_UserAptitude set State = '0' where ID = '" + Lend.StrID + "'";

            try
            {
                if (strInsert != "")
                {
                    intInsert = sqlTrans.ExecuteNonQuery(strInsert, CommandType.Text, null);
                }
                if (strUpdate != "")
                {
                    intupdate = sqlTrans.ExecuteNonQuery(strUpdate, CommandType.Text, null);
                }
                sqlTrans.Close(true);
            }
            catch (SqlException e)
            {
                sqlTrans.Close(false);
                a_strErr = e.Message;
                return(-1);
            }

            return(intInsert + intupdate);
        }
Example #2
0
 public static bool UpdateNewLendAptitude(UCertificatLend Lend, ref string a_strErr)
 {
     if (UserAptitudePro.UpdateLendAptitude(Lend, ref a_strErr) >= 2)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }