예제 #1
0
        public IHttpActionResult Login(DataObj dataObj)
        {
            try
            {
                var json = JObject.Parse(dataObj.dataObj);
                //if (! json.h("password"))
                //{
                //    return Content(HttpStatusCode.OK, "You must Provide 'password' parameter");
                //}
                SqlDataReader rdr = null;
                SqlCommand    cmd = new SqlCommand();
                SqlConnection c   = new SqlConnection(ConfigurationManager.ConnectionStrings["InventoryConnection"].ConnectionString);
                cmd.Connection  = c;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "SP_Tablet_Login";
                cmd.Parameters.Add("@username", SqlDbType.NVarChar).Value = json["username"];
                cmd.Parameters.Add("@password", SqlDbType.NVarChar).Value = json["password"];

                c.Open();
                rdr = cmd.ExecuteReader();
                DataTable dt = new DataTable();
                dt.Load(rdr);
                c.Close();
                return(Content(HttpStatusCode.OK, dt));
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.InternalServerError, "Exception : " + ex.Message));
            }
        }
예제 #2
0
        public IHttpActionResult Max_Transfer_Bond(DataObj dataObj)
        {
            try
            {
                SqlDataReader rdr = null;
                SqlCommand    cmd = new SqlCommand();
                SqlConnection c   = new SqlConnection(ConfigurationManager.ConnectionStrings["InventoryConnection"].ConnectionString);
                cmd.Connection  = c;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "SP_Tablet_Max_Transfer_Bond";

                c.Open();
                rdr = cmd.ExecuteReader();
                DataTable dt = new DataTable();
                dt.Load(rdr);
                c.Close();
                return(Content(HttpStatusCode.OK, dt));
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.InternalServerError, "Exception : " + ex.Message));
            }
        }