Ejemplo n.º 1
0
        public string updateMark(ATTmarks ATTmarkObj)
        {
            DLLmarks DLLmarkObj = new DLLmarks();
            string   resMsg     = DLLmarkObj.updateMark(ATTmarkObj);

            return(resMsg);
        }
Ejemplo n.º 2
0
        public ATTmarks getMark(int sn)
        {
            SqlConnection connection = new SqlConnection(connString);
            ATTmarks      ATTmarkObj = new ATTmarks();
            string        sp         = "dbo.getMark";

            connection.Open();
            SqlCommand cmd = new SqlCommand(sp, connection);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@qid", SqlDbType.Int, 10).Value = sn;
            SqlDataReader dReader = cmd.ExecuteReader();

            while (dReader.Read())
            {
                ATTmarkObj.qid     = dReader.GetInt32(0);
                ATTmarkObj.math    = dReader.GetDouble(1);
                ATTmarkObj.science = dReader.GetDouble(2);
                ATTmarkObj.english = dReader.GetDouble(3);
                ATTmarkObj.social  = dReader.GetDouble(4);
            }
            connection.Close();
            dReader.Close();
            return(ATTmarkObj);
        }
Ejemplo n.º 3
0
        public string updateMark(string mark)
        {
            BLLmarks BLLmarkObj = new BLLmarks();
            ATTmarks ATTmarkObj = jss.Deserialize <ATTmarks>(mark) as ATTmarks;
            string   msg        = BLLmarkObj.updateMark(ATTmarkObj);

            return(msg);
        }
Ejemplo n.º 4
0
        public string getMark(int sn)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            DLLmarks             DLLmarkObj = new DLLmarks();
            ATTmarks             ATTmarkObj = DLLmarkObj.getMark(sn);
            string resMsg = serializer.Serialize(ATTmarkObj);

            return(resMsg);
        }
Ejemplo n.º 5
0
        public string updateMark(ATTmarks ATTmarkObj)
        {
            SqlConnection connection = new SqlConnection(connString);
            string        resMsg     = "";
            string        sp         = "dbo.updateMark";

            connection.Open();
            SqlCommand cmd = new SqlCommand(sp, connection);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@qid", SqlDbType.Int, 10).Value       = ATTmarkObj.qid;
            cmd.Parameters.Add("@math", SqlDbType.Float, 50).Value    = ATTmarkObj.math;
            cmd.Parameters.Add("@science", SqlDbType.Float, 50).Value = ATTmarkObj.science;
            cmd.Parameters.Add("@english", SqlDbType.Float, 50).Value = ATTmarkObj.english;
            cmd.Parameters.Add("@social", SqlDbType.Float, 50).Value  = ATTmarkObj.social;
            cmd.ExecuteNonQuery();
            resMsg = "success";
            connection.Close();
            return(resMsg);
        }